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

learn more… | top users | synonyms (1)

1
vote
2answers
59 views

How to identify user and server with short commands?

I've been teaching my students the basics of the Unix OS (and Linux) for 4 weeks now. I want to give them a home assignment next. It's the first one so the questions and tasks won't be hard. My only ...
0
votes
0answers
44 views

How to get mpd to recognize music library?

I have arch running on my desktop and I'm trying to play music with mpd using ncmpcpp. They are both up and running, but the problem is when I open ncmpcpp it doesn't show my music. I copied the music ...
0
votes
1answer
92 views

How to determine Apache user from the command-line?

There is a question about the group, but I couldn't find any question/answer for getting the Apache user. Therefore how to determine Apache user from the command-line?
1
vote
2answers
42 views

Outputting common lines from 2 files and uncommon lines from both the files in one output file

I have 2 text files. Lets name them file1.txt and file2.txt file1.txt is as follows chr10 181144 225933 chr10 181243 225933 chr10 181500 225933 chr10 226069 255828 chr10 255989 267134 ...
5
votes
7answers
968 views

What is the easiest way to add a string on the beginning of every line of the file from the command line?

I am looking for a way to add some string to the beginning of every line (same string for every line). Not something customizable but rather something that will be easy to remember and available on ...
6
votes
3answers
2k views

Easy way to paste command line output to paste bin services?

Are there any command line tools on Linux that allow you to post output from commands or text files directly to a sharing service such as pastebin.com?
3
votes
9answers
3k views

How to generate a year-quarter date from the command line?

I'm interested in outputting a representation of the current year-quarter, as well as the year-quarter for the previous month. If today is 2012 January 1st, I'd like to get 2012q1 and 2011q4 as ...
44
votes
5answers
2k views

cd by just typing the directory's name?

I either had this somewhere 20 years ago or I dreamed about it. Basically: If if type blobblob I get blobblob: command not found Fair enough. I would like it so that when my shell gets those ...
1
vote
2answers
77 views

How to kill all processes for a given user that take longer then X time

When I list processes with ps auxf I often see some that are stuck and I need to manually kill them. How can I do it with one command? Example ps result: $ ps auxf USER PID %CPU %MEM VSZ ...
2
votes
0answers
22 views

Close All Piped Commands if one close

I'm running at least 3 commands (with progs) using pipes. For example program1 bla bla | program2 blabla | program3 bla bla Is possible to close all programX PIDS automatically if at least one ...
1
vote
2answers
773 views

What is the difference between the whatis and apropos commands?

CentOS 6.3 / RHEL 6.3 Can someone please explain the difference between the whatis command and the apropos command? I noticed that both appear to be installed by default and I'm not sure what the ...
38
votes
3answers
48k views

ssh-add complains: Could not open a connection to your authentication agent

I've been trying to get ssh-add working on a RaspberryPi running Raspbian. I can start ssh-agent, when I do it gives the following output into the terminal: ...
1
vote
1answer
50 views

Is autocompletion for applications done by shell?

When I type evince, and then hit tab, the bash shell will list all files that can be opened by evince, which seems to be based on the ext part of the filename. Is this done by shell or the ...
1
vote
2answers
79 views

Use awk to find first occurrence

I have a log file that gets updated when my script runs. The script will insert "Start of script" text when it starts and "End of script" text when it finishes running. I am trying to capture the ...
5
votes
7answers
784 views

Linux command line. Move all files and directories in directory, except some files and directories

I have a folder A which has files and directories, I want to move all those files and directories to another folder B, except file, file2, directory, and directory2. How can this be done?
0
votes
0answers
31 views

What does !$ mean exactly? [duplicate]

echo !$ outputs different strings depending on my previous command line call. For example: mrdumbdumb-redhat:~ mrdumbdumb$ ls mrdumbdumb-redhat:~ mrdumbdumb$ echo !$ echo ls ls ...
1
vote
1answer
695 views

How to get byobu to start at startup with a command executed, as root?

I want when the computer start, a byobu session is started and a command executed in the first window (windows 0), without requiring any user intervention. It is very important that this doesn't ...
2
votes
4answers
179 views

How to display the number of lines, words and characters in separate lines?

I want to display the number of lines, words and characters, in a file, in separate lines? I don't know anymore than using wc filename for this.
5
votes
4answers
4k views

How to use ifconfig to show active interface only

By default ifconfig will show me all available interfaces , but what if I just want to display active ones? Like, en0 only in below. en0: ...
3
votes
2answers
110 views

get result text from CLI command

I'm writing a bash script and I need to capture the text resulting from the output of the rsync command, for instance, the following command: rsync -av "$FOLDER1" "$FOLDER2" prints: ... sent ...
7
votes
1answer
370 views

Is there a way to make perl -i not clobber symlinks?

A friend of mine points out that if you do: perl -pi.bak -e 's/foo/bar/' somefile when "somefile" is actually a symlink, perl does just what the docs say it will do: It does this by renaming ...
8
votes
7answers
10k views

How do I install a PHP CLI with a usable interactive prompt on Debian Wheezy?

When I install php5-cli on Debian Wheezy (currently testing), the interactive prompt is very unusable due to missing readline support (bug 341868). What's the easiest way to install a version linked ...
2
votes
2answers
46 views

How to make an infinitely executing command kill itself when certain conditions are met?

I'm running a command on command line which infinitely generates a certain data and I'm looking for a particular bit of data, so I used grep to find it. As soon as I get the data, I want the command ...
32
votes
4answers
2k views

Reverse grepping

Let's say, I have a really big text file (about 10.000.000 lines). I need to grep it from the end and save result to a file. What's the most efficient way to accomplish task?
1
vote
1answer
179 views

How do I Nohup an interactive shell-script?

My Script is having 2 command-line arguments and then just couple of questions, after these questions the script will run for itself, I'm able to pass the command-line argument by just doing, ...
2
votes
3answers
103 views

Standard and portable way to send email from console?

What is the most portable or standard way to send an email from the console or a script on Linux, and possibly Unix?
1
vote
3answers
241 views

Execute a file if a command is not found

When I try to execute files in Linux, I'm always annoyed by the need to write ./executablefile instead of just executablefile. I get why it's done, so it won't have an ambigous input, one that is a ...
1
vote
0answers
61 views

How to connect tata photon in X window manager in ubuntu 14.04 using command line

Due to some reason I had to shift from Gnome to X(basic X). So here on the desktop nothing appears (no launcher, no menu bar, nothing) but we can open command line in it using Ctrl+Alt+Tab. (I have ...
14
votes
4answers
30k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
0
votes
1answer
31 views

Command line utility to learn bit twiddling hacks

I am currently reading Hacker's Delight and would like to practice as I read through the book. Is there any command line *nix tool to perform binary operations and see output in binary?
1
vote
3answers
78 views

What is the concept hidden behind the term “command”?

I have been using, studying and developing for Linux for quite a few years now, and over time, I have successfully convinced a few people to join the cause, and make the switch to Linux. However, ...
1
vote
4answers
413 views

Why do we use double hyphen in “tar --anchored” and single hyphen in “tar -b”? [duplicate]

Why do we use double hyphen in tar --anchored and single hyphen in tar -b? I mean to say why some command line options have single hyphen (-) while some others have double (--)? Also a git example: ...
6
votes
2answers
2k views

How to replace a symbolic link with a copy of a file it links to?

Having a (single, no batch filesystem processing needed) symlink, what a command line to use to replace it with a copy of the file it links to?
2
votes
4answers
160 views

How to disable a shell keyword?

Using enable builtin command we can disable a shell builtin command, for example echo, as follow: enable -n echo But how can we disable a shell keyword like time? If we try: enable -n time we ...
1
vote
1answer
95 views

Apply recursive chmod to files or folders only

I'd like to apply chmods to files and folders in one line, Basically: chmod 700 ./* -R # but only apply to folders chmod 600 ./* -R # but only apply to files Of course I searched google and read ...
5
votes
3answers
850 views

How to disable beep sound in Linux CentOS 7 command line? [duplicate]

I just installed the basic Linux CentOS 7 (no desktop) and am experimenting with the system. Every time I make a mistake (entering things that the command line doesn't like), the computer beeps and ...
2
votes
1answer
106 views

How to sort files based on the json property value inside the file?

I've downloaded list of videos via youtube-dl and each file has corresponding .json file containing certain properties. So I would like to sort the files based on the selected json property which is ...
1
vote
1answer
43 views

how to detect video completion in vlc

Vlc provide documents in which there are lots of command are given to control vlc from command line. Here is the link of documentation. Now in my task, I need to run a video in a loop, for this I am ...
0
votes
0answers
6 views

Is there a way to scan all configured maven repos for a a package?

Lets say I am writing code and I decided I want a certain package, but I don't know rather the repos I have setup have that package, or which version of the package they may have. Is there a quick ...
23
votes
8answers
8k views

How to understand what's taking up space?

I'm looking for a linux alternative to WinDirStat. I would like to know what is taking up space on my hard drives. A program that works on console and doesn't require a UI is preferred .
1
vote
3answers
121 views

How to do command-line completion with files and folders

As a new Linux user, one of the things that's kept me away from the Command Line (CL) is that, for tasks involving files and folders (i.e. everything!), the amount of typing involved makes using the ...
3
votes
1answer
2k views

Set Ubuntu System Proxy Settings without Restart from commandline

I am using Ubuntu 14.04 . I want to change the http proxy settings from the command line. This should be equivalent to changing in the GUI(All Settings->Network->Network Proxy) and clicking the button ...
4
votes
2answers
6k views

How to list ALL directories according to their size? [without including the parent directory]

I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes. I have something on the lines of this in mind: ls -d -1 -a */ ...
2
votes
2answers
297 views

Print text from terminal

I would like to use a Linux distro without a desktop environment, but I need to print out homework that I type up. I could always email it to myself and print from another computer, but it would be ...
21
votes
9answers
31k views

Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command. $ convert image1.jpg image1.pdf But I have 100 images. How should I convert all of them to corresponding pdfs? I ...
16
votes
2answers
1k views

Create a test file with lots of zero bytes

I know how to create an empty file: touch /var/tmp/nullbytes but how can I create a 1MB file that only contains nullbytes on the commandline with bash?
1
vote
1answer
109 views

Command-line parameters in bash script not recognised

I use Debian (Raspbian) Wheezy. If this command line works fine: smsd -c sms/out -i 60 -0 -f sms/smsd.log and this alias also works fine: bsmsd='smsd -c sms/out -i 60 -0 -f sms/smsd.log' then ...
27
votes
5answers
5k views

How to echo a bang!

I tried to create a script by echo'ing the contents into a file, instead of opening it with a editor echo -e "#!/bin/bash \n /usr/bin/command args" > .scripts/command The output: bash: ...
2
votes
1answer
211 views

Login to Skype from terminal or any other way

Please let me know if anybody knows how to login to Skype on Linux Mint from terminal or any other way? I have tried a lot but nothing found. Desktop # ./skype.desktop ./skype.desktop: line 1: ...
1
vote
1answer
66 views

Listing audio files with bit rate in the command line

Is there a way to list the contents of a folder via the command line in such a way that the audio files in mp3 format have the bit rate info? I tried ls -l but it doesn't work.