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

learn more… | top users | synonyms (1)

4
votes
2answers
14k views

Difference between ifconfig and ipconfig? [closed]

What is the difference between ifconfig and ipconfig? What do dhcpcd and ifconfig actually do?
1
vote
1answer
13 views

View path options when using readline?

When I am typing in a path at the bash prompt I sometimes do not remember what the directories are so I cannot incrementally search for them. Is there a way in readline to cycle through the ...
2
votes
4answers
42 views

Access a file located with find

In many cases after I find a file using the find command I then want to open the file or cat it or maybe print it. How can I operate on the result from find? For example, : find . -name "myfile.txt" ...
1
vote
1answer
26 views

Move files several directories up for several directories with similar layout

I have a directory with the following layout (the layout in Directory 1 is repeated in every other Directory <num>): Parent directory Directory 1 some directory another ...
2
votes
6answers
8k views

ls command - define number of columns

Is there a way to define the number of columns in ls output? I got this far: ls -C sorts in columns and ls -1 produces one column. --tabsize = option to produce two columns resulted in what looks ...
0
votes
2answers
40 views

How can I copy a hidden directory recursively and preserving its permissions?

mkdir backupcache cp -rp .cache backupcache # or cp -rp \.cache backupcache does not work nothing gets copied and directory backupcache remains empty
1
vote
2answers
117 views

find: meaning of the \? sign as a value of the name parameter

What is the meaning of the ? sign in the following command? find /foo/path -name \?
1
vote
2answers
38 views

A quicker way to change owner/group recursively? [duplicate]

Currently, when I want to change owner/group recursively, I do this: find . -type f -exec chown <owner>.<group> {} \; find . -type d -exec chown <owner>.<group> {} \; But ...
1
vote
0answers
16 views

detecting sound from speakers

I have decided to make a radio from my old laptop. I installed Puppy linux and set special features, like: after waking up, it turns on my favorite online radio (openFM) and switches off the screen. ...
21
votes
5answers
2k views

How to run a command at an average of 5 times per second?

I have a command-line script that performs an API call and updates a database with the results. I have a limit of 5 API calls per second with the API provider. The script takes more than 0.2 seconds ...
1
vote
2answers
39 views

How to upgrade/downgrade a specific package from “sid” on debian jessie “stable”? [duplicate]

I need to upgrade some specifics packages from sid on debian jessie stable with their dependencies. By adding the following repo : deb http://ftp.fr.debian.org/debian/ sid main deb-src ...
3
votes
4answers
117 views

Where should I save color codes for the PS1 command line / terminal? [on hold]

This question is about best practices. I know logging in over secure shell or switching users su, and su -l have different effects. Also, in the event you make a typo in the configuration, you still ...
4
votes
4answers
56 views

Most efficient way to thin out a backup which uses hardlinks

I have a backup disk which contains hundreds of backups of the same machine from different dates. The backup was made with rsync and hardlinks, i.e. if a file doesn't change the backup script just ...
36
votes
11answers
28k 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 .
12
votes
2answers
6k views

Ctrl+D for ending terminal line input

If I do $ cat > file.txt textCtrl-DCtrl-D Question 1: If I don't press enter, why do I have to press Ctrl-D twice? If I do $ cat > file.txt pa bam pshhhCtrl-Z [2]+ Stopped ...
0
votes
1answer
30 views

FFMpeg : Creating a video clip of approx. 10 seconds when video duration is unknown without audio-

I am working on a project where I am looking to extract a video clip from an input video. I have found many links(Eg : link) which do this task, but in all this I have to specify video duration. ...
1
vote
1answer
80 views

pattern matching without echo

Why are the outputs different? touch a aa bb ccc echo * a aa bb ccc // I understood, * means matches zero or more * aa bb ccc // I'm confused. echo ? a //OK ? a aa bb ccc // confused ...
1
vote
4answers
56 views

execute command over ssh connection [duplicate]

I want to excecute the following command over a ssh connection: tmpValue=$(cat /var/run/jboss-as/jboss-as-standalone8.pid) && top -b -U jboss -n 1 |grep $tmpValue |awk '{print $9}' This ...
0
votes
1answer
3k views

IBM V7000 scripts for monitoring

Hello (I'm no hard core coder:), I try to develop a script to do some very basic monitoring on an IBM SVC. My goal is to get some information about the nodes and my quroum status and then send ...
166
votes
9answers
281k views

How do I get the size of a directory on the command line?

I tried to obtain the size of a folder (containing folders and sub folders) by using the ls command with option l. It seems to work for files (ls -l file name), but if I try to get the size of a ...
19
votes
5answers
21k views

find n most frequent words in a file

I want to find, say, 10 most common word in a text file. Firstly, solution should be optimized for keystrokes (in other words - my time). Secondly, for the performance. Here is what I have so far to ...
14
votes
4answers
123k views

How do I exit or cancel a bad bash command?

I expect to get some flak for this, but I can't find the answer anywhere. It seems like it should be so obvious. Sometimes, when I type a bad command in a bash terminal, the cursor just jumps down to ...
1
vote
1answer
56 views

copy huge number of files into date structured directory order

I need to copy around 40.0000 files into date structured folders. example file: /var/public/voicelogging/quality_monitoring/20151209/bbbbbb_I_20151209-185841_xxxxxx_12434_89343.WAV Is one of the ...
10
votes
3answers
7k views

Getting and setting screen size for Xorg

I would like to run a command like get-screen-resolution during a X session to get a '800x480' output. ( or whatever the actual screen size is ). Is there something available for this? Currently I ...
4
votes
7answers
10k views

Fast tool to generate thumbnail video galleries for command line

I use gframecatcher to generate thumbnail video galleries, i.e. something like this: However this is a GUI tool and I want to create recursively a gallery for every video in a directory structure, ...
1
vote
2answers
25 views

List of mount points of external storage devices such as USB keyfobs and SATA external drives, from the cli

I need to list all mount points associates to external storage devices such as USB keyfobs and SATA external drives. The only way I found under Ubuntu, is to call 'mount' and grep for '/media'. But ...
2
votes
2answers
5k 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
1answer
3k views

How do I decrypt a message using openssl's CLI?

I have a message, I know the password and the cipher that was used to encrypt it, but I can't figure out how to ask openssl to decrypt it. I see the cipher in the output from the ciphers command, and ...
-2
votes
2answers
49 views

find all jpg images from specific directory and copy it to other directory

How do I copy all the jpg images [files whose names end with .jpg] that exist in the directory /usr/share/backgrounds into to the jpg directory in /week/pictures/final/jpg then redirect any error ...
1
vote
1answer
50 views

Command line tool for easy multiline regex search and replace

I use PCRE regular expressions for search and replace very often when working with a text editor and I was left quite unhappy after I found out that in powerful Unix command line tools like perl, awk ...
2
votes
1answer
25 views

Extract TOC of epub file

Lately I hit the command that will print the TOC of a pdf file. mutool show file.pdf outline I'd like to use a command for the epub format with similar simplicity of usage and nice result as the ...
11
votes
2answers
29k views

What's the easiest way to resize an ext4 partition from the command line?

What's the easiest way to resize an ext4 partition (or any type partition depending on the method) from the command line (potentially with the fewest commands, but also the easiest to understand)? ...
1
vote
0answers
22 views

What happens if I try to use a device driver from the shell and it is already being used by the kernel?

This is the situation. I'm new to embedded linux and I'm trying to test some commands for the LED driver LP5521. The board I have has a RGB LED with this controller IC and it is being initialized with ...
-1
votes
3answers
26 views

Get compilate date [duplicate]

I am trying to extract the compilation date from a linux command (or cpp would be fine too). I am using: stat -c %z ./myProgram.bin However, if I copy myProgram.bin to an another place via ssh for ...
4
votes
1answer
48 views

Why grepping with color doesn't return anything?

I've got the following foo.txt file: This is the first line. This is the middle line. This is the last line. And I'm trying to grep the middle line just by the word middle and return the ...
0
votes
1answer
15 views

Why am I receiving the error: “sudo: update_prebinding: command not found” on the command line?

One of my applications won't open so I'm trying the first thing to do on this website: http://www.cnet.com/news/tutorial-what-to-do-when-a-mac-os-x-application-will-not-launch/ But I am getting an ...
1
vote
1answer
92 views

A quit command weaker than windowkill?

Typing in xdotool getwindowfocus windowkill currently terminates the active window and bypasses any safeguards like "would you like to save your work?". Is there a weaker command than windowkill I ...
3
votes
1answer
37 views

groupadd -p Not Recommended?

I have a question about groupadd, specifically with password (-p). It says it is not recommended, "This option is not recommended because the password (or encrypted password) will be visible by users ...
2
votes
1answer
64 views

FFMpeg : Converting a video file to a gif with multiple images from video

I am working on a project in which the user can upload videos. Is there any way with FFmpeg I can take some images from the video and create a GIF out of it? As the project is in Java, I have a way ...
1
vote
3answers
68 views

How can I print a section of a manual (man)?

From command line, how can I do in order to show a specific section of the result of man something? For example, if I wanted to get some information about the return value of C function write, I'd ...
3
votes
2answers
773 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 ...
1
vote
1answer
43 views

Command works, and then doesn't (cd/ls)

I'm currently doing my thesis and thus working on a school server. And unfortunately, I'm struggling with even the most basic concepts. Such as this. I have a directory /home/myname/Data If I'm in ...
0
votes
1answer
60 views

How to write bash script while using command as condition in if statement?

I am writing a bash script to process input from html form. I have two issues which I can't seem to be able to figure out. I am a beginner to Unix. First problem is that I can't get my if statement ...
2
votes
1answer
30 views

Improve existing alias to dynamically replace command line text

I have an alias in .bashrc like this: alias ylog = "yarn logs -applicationId" This works well when I do ylog application_123. Sometimes, my job names come in the form of job_123 instead of ...
8
votes
3answers
5k views

Show a notification across all running X displays

Using the command line, I'd like show a notification on every running X display. ( and running console ) Something like: notify-send-all 'Warning' 'Nuclear launch in 5 minutes, please evacuate' Is ...
3
votes
1answer
2k 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
2answers
44 views

rlwrap: tclsh multi-word autocompletion

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
0
votes
3answers
50 views

How do I remove a dot dollar no name directory

I have this weird directory in Oracle Linux that I cannot remove, cannot change owner, cannot change group, etc. It seems to be an environment variable that is empty and is named: .$EXTEND Here's ...
1
vote
1answer
29 views

Is there an additional option to display hidden command on the terminal?

Copy and pasting from a website to the terminal is very harmful , there are an example here You past the following line :ls /some/thing/much/too/long/to/type/ , by pressing Enter the following ...
86
votes
30answers
25k views

Quick directory navigation in the terminal

I would like to frequently switch between directories that are in totally unrelated paths, for example /Project/Warnest/docs/ and ~/Dropbox/Projects/ds/test/. But I don't want to type cd ...