The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

0
votes
3answers
23 views

Adding zero in front of small decimal places [duplicate]

so when I'm coding Im trying to have the output print out 0.12 instead of .12. Here is my code below echo -n "What is the total cost? "; read cents cost=$(echo "scale =2;$cost_in_cents/100" | bc); ...
1
vote
3answers
26 views

How to write output to a file of the same name as the input?

I am wondering how to to process files from some folder dir1 if they are piped through various tasks and in the end I'd like the output to be written in the same folder structure and file names, i.e. ...
3
votes
3answers
152 views

Print out list of files less than specified file size

I'm trying to create a script that can be executed to search a list of files, compare the file size field to the specified file size, and then display the files that are less than the specified file ...
2
votes
1answer
31 views

linux/unix command for checking the outside/inside network connections

From my local machine, which command can tell me which machines I have connected via ssh, or ftp, etc? At the same time, which command can let me know which machines have tried to connect my machine ...
2
votes
3answers
48 views

How to send a command with arguments without spaces?

Is there a way to execute a command with arguments in linux without whitespaces? cat file.txt needs to be: cat(somereplacementforthiswhitespace)file.txt
2
votes
0answers
37 views

Execute each command in terminal from top line / Execute clear before each command

I would like to ask if it is possible to set up in bash so that each command is executed from of the top of terminal window. In other words if it is possible to execute clear before each command. ...
3
votes
2answers
35 views

Access Kali Linux display properties from command line [on hold]

I have a Kali Linux boot that I'm using on a laptop with a broken screen connected to an external monitor via HDMI. At the moment when the laptop boots, it displays the primary screen on the broken ...
1
vote
1answer
38 views

Save cached video on firefox?

I found a script on the internet that allows me to save cached flash files. https://github.com/janosgyerik/shellscripts/blob/master/bash/save-flash-linux.sh This would allow me to run the command ...
1
vote
3answers
66 views

Command Line customization [on hold]

I was looking a video on how to install Kubernettes on Ubuntu, the guy on the video has this really cool way on displaying his command line in a terminal. I was wondering if someone could help me to ...
-1
votes
1answer
34 views

Alternative to typing the path for /sbin/ifconfig [duplicate]

Everytime I need to access ifconfig , I find using using /sbin/ifconfig. If I need to directly type ifconfig in bash and get the required output without calling the directory every time, what should I ...
2
votes
0answers
38 views

Coloring terminal commands (like LS and CD)

I do know I can color my terminal using the PS1 variable. Now, I would like to discover if there is a way to put some color on the bash commands I often use. I'd like to type, something like, "$ ls /...
1
vote
2answers
26 views

How do I filter by STAT with ps?

I am trying to get all the processes for which the value corresponding to the STAT column is X. I have done this using awk ps -aux | awk {'if ($8 == "S") print $8" "$11'} However, I would like to ...
1
vote
1answer
25 views

How to check port opened on running a service?

Let's say I started a service by using sudo service service_name start, I am interested in knowing all the port opened by this service. I can know port - program mapping by sudo netstat -tulnp but I ...
0
votes
1answer
47 views

How to add a text file to a zip in one single command? [duplicate]

I want a put a text file in a encrypted zip archive. I would currently use: echo "<my text>" > file.txt zip --encrypt myarchive.zip file.txt Is there a way to do the same thing in one ...
3
votes
1answer
20 views

How do I invoke a process with a certain java binary, and all processes called by that process?

I need to be able to call a certain process with a certain java binary. Call that process "foo". However, foo also invokes several other processes via java, but foo is a black box to me. When foo ...
1
vote
1answer
15 views

Run Scheme one-liner from the command-line

How can I run a Scheme expression from the command-line using neither a script saved in a file, nor starting the interactive shell? The equivalent in Python would be: python -c "print 1+1". scheme (+ ...
0
votes
0answers
23 views

How to extract image data from a (seemingly) corrupted file?

This may be the wrong forum to post this question, but since I'm using a debian OS I figure this would be a good place to start. Before I detail my problem, all of the below is INSTALLED and all have ...
1
vote
1answer
16 views

rsnapshot settings confusion

I'm a newbie in Linux and rsnapshot, I'm trying to set remote backup for my website. in /etc/rsnapshot.conf, I've set the following things but its still not working. snapshot_root /abc_backups/ ...
6
votes
9answers
2k views

How do I parse out just the date from 2017-03-08T19:41:26Z?

I am trying to parse out just the date from 2017-03-08T19:41:26Z. The desired output is 2017-03-08.
3
votes
4answers
69 views

Wrapping a loop around a 'sed'-command processing many files in a single directory

I have text-files containing many lines, of which some starts with ">" (it's a so-called *.fasta file, and the ">"s marks the beginning of a new information container): >header_name1 sequence_info ...
0
votes
0answers
54 views

Edit HTML files from the command line

I'm looking for a way to edit HTML files from the command line similar to sed or awk, but using path expressions similar to jq or pup. In particular, newlines, white space and other formatting details ...
2
votes
2answers
64 views

Sorting issues in Linux

I am sorting files which have gene names and their expression values. All files have same exact number of rows ,however after sorting there is a difference in the positioning of certain genes. This ...
1
vote
1answer
14 views

Record & Play what comes from the microphone at the same time

For a project, I would like to be able to use arecord to do both at the same time : Recording what is passed to the microphone. Playing it at the same time in the speakers. In order to do this, I ...
1
vote
0answers
80 views

bash escape exclamation character inside variable with backtick

I have this bash script name test.sh and located in /tmp: source $HOME/.backmeuprc databases=`mysql -h$DBHOST -u$DBUSER -p$DBPASSWORD -e "SHOW DATABASES;" | tr -d "| " | grep -v Database` the ....
1
vote
2answers
36 views

pass answer to git command

I try to get "git pull". It is asking for username and password. How i can automate it? ➜ git:(master) git pull Username for 'http://127.0.0.1': username Password for 'http://[email protected]': ...
3
votes
0answers
17 views

Synchronize IMAP to maildir folders - fast and complete solution with IDLE support?

This is likely to be borderline subjective, but I am searching for good alternatives for command line IMAP to maildir clients: Currently I am using offlineimap, but the docs are lacking, and support ...
0
votes
0answers
19 views

What is the origin of '~' being used to refer to the users home directory? [duplicate]

Also where do the other short hand terms for directories originate from: .. //up a directory - // previous directory . // current directory What is the generic term for these symbols? Are they ...
0
votes
0answers
31 views

how to generate fractals from audio output?

How to generate fractal video/image from the audio output I have tried with flam3 | pulseaudio | alsa-sink-ALC25 without succes
1
vote
1answer
14 views

'mail' use problem from command line

I didn't have mail installed before, so I've did it using: apt-get install mailutils After that I've tried to send a mail with this command: mail -s "Ssubjects" [email protected] But I see just this ...
0
votes
1answer
39 views

A Tool to measure onscreen drawn rectangle? [duplicate]

I am looking for a tool that runs via command line. sort of like xprop xdotool it simply needs to allow me to draw a rectangle on the screen. and tell me the measurements of it. I have tested out:...
1
vote
1answer
20 views

Alert in virtual console

How do I show an alert in virtual console ttyX (not necessarily the active one) so that the user sees the alert on the next command invocation. I'm looking for something similar to the "you have mail" ...
0
votes
1answer
14 views

strange wrapping of file paths

I have a PHP script run form the command line on an AWS AMI Linux EC2 instance that echos out when it is renaming files, and it is wrapping the end of the string back to the beginning. The string ...
1
vote
1answer
23 views

Convert epoch date output from command result to human readable

I've been trying to nut this out, but I'm stumped... I've tried to extrapolate the commands I found at How to replace epoch timestamps in a file with other formats?, but I'm can't get it yet. My ...
0
votes
2answers
54 views

cat file : prints prior to “user :/” prompt

file contains just 1 line: aaa when I run "cat file" it mixes to username user /dir : cat file aaauser /dir : What could be the problem ? Extra Info: perhaps this is not properly set in bashrc ? ...
1
vote
1answer
36 views

Find all videos by codec (and not by container formats or MIME type)

How can I get the list of all my videos with the used video codec? I found some intersting commands like mediainfo, ffmpeg or exiftool but they giving a lot of informations only by one video. The ...
0
votes
4answers
37 views

Give previous date as argument to shell script

I need to execute the script by passing previous date as command line argument. It must be automated. So, how can i pass the previous date to the script? For example: sh processFile.sh previousdate ...
3
votes
0answers
21 views

tmux random characters appearing in terminal

I'm experiencing a strange problem with tmux appearing whenever I enter copy mode and I have multiple panes. Basically, after I select the text, when I press Enter (vi-mode) or Alt-w (emacs-mode) a ...
0
votes
3answers
41 views

How to merge two csv files with common but differently ordered headers?

I have multiple files (>150) with multiple columns (>150). Most of the headers are common but occur in different order (as eg below): File 1: Col1 Col2 Col3 Col4 Col5 A B C D E File 2: ...
0
votes
2answers
35 views

Delete lines containing empty fields

I want to delete the lines containing empty fields in the last row $7 File: 1 1479870 5022248660 1 40001 189445122 740020 1 1911574 3015889020 1 33001 162049034 633004 1 1569783 5029193930 1 22001 ...
5
votes
5answers
190 views

Find fullpath and filename under a directory then pass to an executable file as arguments

I'd like to find fullpath and filename of all .txt under a directory, and pass to a executable file ./thulac . It cost me some time to reach: find /mnt/test -name "*.txt" -print0 |xargs -l bash -c '....
0
votes
0answers
16 views

Bash commandline syntax highlighting [duplicate]

I was wondering: Is there any way to syntax-highlight your currently typed command inside of bash? So that when I type for instance sudo ls -lAF /etc that the entire command is colorcoded according to ...
-1
votes
5answers
80 views

Merge files using a common column value [closed]

I want to join these 2 files : File 1 (1 million lines) and File 2 (10,000 lines) in new File 3 (should be 1 million lines) using an awk command File 1 : 471808241 29164840 1 10001 156197396 ...
0
votes
1answer
31 views

Combining enscript, find, iconv and ps2pdf

I'm trying to write a small bash script that'll convert source files in a directory to a .pdf. The steps are these Locate files with find execute iconv on the files converting the character encoding ...
1
vote
1answer
47 views

How can I check mail from the command line?

I use Evolution to send and receive mail via IMAP. I want to keep using Evolution most of the time, but I want the option to check and read mail from the command line as well. Reading a new email from ...
4
votes
1answer
161 views

How do I set a static IP address for a disconnected interface?

I am setting up an Arch/Manjaro-based machine that only occasionally will be connected to network. I.e. most of the time its Ethernet card is disconnected. I run into this curious problem - when I ...
-2
votes
1answer
29 views

meaning of some commands ? , the hackers play book 2 [closed]

i don't understand what's the meaning of the -a in dpkg --configure -a and what's the meaning of the -y is apt -y install ? , i always find-letters that i never understand what's there meaning , can ...
2
votes
4answers
52 views

Grep with range and pass three filters

I have a file sample.txt ------------- ord:chandru SAM XY DUPL KEY:ZZ ------------- ord:RAM SAM XY DUPL KEY:UU ------------- ord:chandru SAM XY DUPL ...
0
votes
1answer
17 views

Enable command line completion of *.md files for firefox in konsole

When opening files in Firefox from konsole, the autocomplete function only works for certain file extensions like html, htm and the like. For other extensions, I have to type out the full name instead....
1
vote
1answer
32 views

Extract user group while trying to connect using ssh

I have extracted the user name to perform a test: w | grep ^usera | wc -l which will show 1 if the usera have an open session, but now I need more generic use case to extract user group. Example: ...
3
votes
2answers
50 views

user not allowed to connect to wifi

I have a Debian 8 jessie minimal install connected to a wired network. No X server is installed and no GUI. On this system I log in as unpriviledged user and I notice that the following commands are ...