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

learn more… | top users | synonyms (1)

1
vote
3answers
35 views

How to display contents of mounted /boot and '/' root partitions?

How to display contents of mounted /boot and '/' root partitions of Debian on SSD drive from Linux Live CD? I know ls -1 to list directory contents, but what is exact steps to get this?
6
votes
5answers
12k views

count lines in a file

I'm sure there are many ways to do this: how can I count the number of lines in a text file? $ <cmd> file.txt 1020 lines
13
votes
2answers
5k views

How do I find the window dimensions and position accurately including decorations?

I've been trying to figure out the size of a window for use in a small script. My current technique is using wmctrl -lG to find out the dimensions. However, the problem is this: The x and y figures ...
2
votes
2answers
605 views

How to change a firefox option on a quick way (via shortcuts, command line,..)?

In Firefox we have two options at Firefox->Preferences->Preferences->Fonts and colors->Colors menu, Use system colors and Sites can use other colors. I would like keep the first one ...
8
votes
3answers
887 views

How do I take a list and remove it from a file?

I have a long list of domain names that I need to remove from /etc/remotedomains. They're probably not in any particular order in the file. Each domain is on one line. How could I iterate through the ...
0
votes
0answers
16 views

How to modify ENV in Solaris 10

I wanted to edit the contents of environment when entering this "ENV" in terminal. I googled this but so far none of the solution offered works in my end. The closes solution that i got was to edit ...
100
votes
27answers
21k views

Tracking down where disk space has gone on Linux?

When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time ...
4
votes
3answers
366 views

Switching among cli and vim and other files workflow

I saw some kind of workflow in vim: Vim had a file open. Then some combination of keys made vim disappear and the user was in the command line working in cli mode, then opened another file and then ...
6
votes
1answer
172 views

Echo difference between Ubuntu and Red Hat

I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying environment variables. In Ubuntu I ...
-3
votes
0answers
52 views

Create my own shell? [on hold]

i need to create a shell in C using fork() and execv() that prompts the user to enter a command followed by a space and an argument. It should then exit as soon as the user enters exit command
0
votes
1answer
288 views

How to get sound intensity of an audio input through terminal?

I want to know the intensity of the sound being heard by an audio in source like a mic or Line-in through Command line. Kinda like the progressbar under the mouse but in CLI. audiointensity mic0 10 ...
1
vote
1answer
18 views

how to recall last argument in bash with vi setting

I use set -o vi setting in bash. The shorcut Alt+. (recalling last argument of previous command) here doesn't work as in emacs mode, so what is the equivalent for vi?
1
vote
2answers
50 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
24 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 ...
13
votes
3answers
5k views

Break a large file into smaller pieces

How do I break a large, +4GB file into smaller files of about 500MB each. And how do I re-assemble them again to get the original file?
0
votes
1answer
22 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
43 views

Print UTF-8 file with command line tools

I want to print a file using a command like cat filename > /dev/lp0 where the file contains characters like ùàç encoded in UTF-8. Is this is possible or do I need to use CUPS? I'm using an ...
1
vote
1answer
758 views

How to access u boot environment from linux?

How can I access and change the u-Boot env variables in linux. Using the u-boot/tools/env directory in u boot directory: u-boot$ make env Which created the executable file fw_printenv. I copied ...
3
votes
3answers
186 views

Method for storing/remembering one liner commands

Often when configuring and adjusting unix-based systems I use a lot of one-line commands that are difficult to remember. For example, to determine what version of ntp (the time server) is running, you ...
1
vote
2answers
32 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
633 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 ...
3
votes
2answers
407 views

Jingle CLI client / Jitsi replacement / VOIP

I am looking for a Jingle client for the command line. Currently, I use Jitsi, but my dreams of not needing the GUI for more than just web-browsing are not realized due to my reliance on this ...
0
votes
1answer
627 views

Proper escaping of double quotations for curl post data?

I'm trying to test out a server, by sending it JSON data and reading the response. I need to POST data like {"item":"value with spaces"} but when I use curl I find that it sends the backslashes as ...
5
votes
3answers
1k 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
2k 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
53 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
20 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
608 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 ...
35
votes
3answers
41k 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
38 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 ...
2
votes
2answers
32 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
627 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
21 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
561 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
140 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.
4
votes
4answers
3k 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
97 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
347 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
9k 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
39 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 ...
1
vote
2answers
563 views

wget to get all the files in a directory only returns index.html

I'm new to using bash, and I have been trying to wget all the files from a website to the server I have been working on. However all I'm getting back is an index.html file. I let it run for 15 minutes ...
30
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
39 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
87 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
159 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
33 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
16k 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
21 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
56 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, ...