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

learn more… | top users | synonyms (1)

1
vote
1answer
21 views

Aliasing a command with special parameters

I would like to have an alias for the following code:- g++ *.cc -o * `pkg-config gtkmm-3.0 --cflags --libs`; but I want that when I enter the alias it should be followed by the file name *.cc and ...
3
votes
3answers
79 views

What is the difference between home$ and ~$?

I'm learning Linux, and I'm a little confused right now. In the below screenshot, I was not able to understand the third shortcut of Table 2-1. It says that cd ~user_name will change the working ...
11
votes
4answers
47k views

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux). I run: sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits' Then I try to obtain an ...
0
votes
1answer
49 views

Delete customers domain extension only (in .csv file)

I have a list of my customers emails and want to remove some that end in .br for example. I would normally do the following command: sed -i '/.br/d' customers.csv But that would also delete a ...
0
votes
0answers
18 views

Pixelated display after run “sensors-detect”

I have a Lenovo y50-17 laptop with Mint linux installed. I started by doing sensors-detect, which I've done on computers in the past. I know I should have stuck with the defaults, but I didn't. ...
0
votes
1answer
2k 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 ...
6
votes
1answer
58 views

Terminal does not accept pasted or typed lines of more than 1024 characters [duplicate]

When I enter text on stdin in an OS X Terminal, a single line is limited to 1024 characters. For example, cat > /dev/null beeps after I type (or paste) a line longer than this, and refuses to ...
1
vote
2answers
54 views

Copy .txt files in a certain directory

I have an issue in copying my file in my directories. I have .txt and .jpeg files in a lot of directories, and I want to copy only the .txt files according to the directory. For example, I have this: ...
28
votes
5answers
23k views

Is it possible to mount a gzip compressed dd image on the fly?

I like create an image backup for the first time I'm backing up a system. After this first time I use rsync to do incremental backups. My usual image backup is as follows: Mount and zero out the ...
1
vote
1answer
16 views

Generating a long sound file with SOX without actually playing the tone

I know how to play a tone for a specific amount of time using SOX. play -n synth 5 sin 347 I know how to save a tone using SOX. sox -n note.mp3 synth 5 sin 347 Question is : How can I save a ...
6
votes
4answers
620 views

pager program like less, able to repeat top N lines

Is there any way to make less program repeat first line (or first 2 lines) on every displayed page? Is there any other pager program which can do this? This would be a killer-app for database table ...
57
votes
3answers
49k views

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming ...
1
vote
1answer
19 views

How can I change the IP and gateway addresses permanently?

I recently installed Linux Ubuntu 14.04 to my computer. To enable internet connection I needed to change my IP and Gateway address. I did the following as a root user # ifconfig eth0 "my ip address ...
-2
votes
3answers
39 views

Can an argument be passed through the “alias” command? [duplicate]

I want to know if i can pass an argument with an alias command. for example: alias d="dmesg|grep -iw usb|tail -5" Now d will print the last 5 lines. if i want to use d to print a different number ...
14
votes
4answers
23k views

How can I make a program executable from everywhere

What should I do if I want to be able to run a given program regardless of my current directory? Should I create a symbolic link to the program in the /bin folder?
139
votes
29answers
71k 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 ...
2
votes
3answers
36 views

Manipulate multiple files by inode

I have a large number of files that contain backslashes \ that I would like to manipulate, but whenever I try something like: $ ls -li 2036553851 -rw-rw-r-- 1 user user 6757 May 20 00:10 ...
5
votes
5answers
111 views

Run `grep` excluding a file in a specific path

I want to exclude the file ./test/main.cpp from my search. Here's what I'm seeing: $ grep -r pattern --exclude=./test/main.cpp ./test/main.cpp:pattern ./lib/main.cpp:pattern ./src/main.cpp:pattern ...
3
votes
4answers
90 views

Run multiple commands and kill them as one in bash

I want to run multiple commands (processes) on a single shell. All of them have own continuous output and don't stop. Running them in the background breaks Ctrl-C. I would like to run them as a single ...
0
votes
1answer
26 views

Linux driver privileges

I've loaded a custom driver to linux via mknod. However, now any programs I write to use it need to be run using sudo, which is difficult to do when I'm using an IDE. Is there any way to adjust the ...
0
votes
1answer
15 views

tmux starts in strange context (window name: 0:python3) and no prompt? [on hold]

Behavior: tmux new -s yields the following screen: Note: no prompt window named 0:python3 If I type ^C I get the following which is what I expected from the beginning: Ideas? Admittedly ...
0
votes
0answers
5 views

Change default XFCE backdrop for all users via cli?

So my situation is that I can change the relevant property for a user if I have Xorg running by xfconf-query, which is the normal way as I understand to do this, but I cannot use this command normally ...
0
votes
1answer
24 views

How does “command < filename.txt” look when passing filename into a command

I've got a scenario where I have command < filename.txt so I can pass the contents of filename.txt and use it in command. But say I want to take the contents out of the file and just use them in ...
0
votes
0answers
44 views

Shell script to send alert if mount point exceeds 75% [duplicate]

How to write shell script to send an alert if any file-system on server exceeds 75%, in one email notification instead of receiving separate alert email notification for each file-system. I am ...
4
votes
1answer
192 views

Create torrent with files from different directories from CLI

I have a directory structure that looks like: dirA fileA1 fileA2 ... dirB fileB1 fileB2 ... I would like to create a torrent using CLI utilities that contains: dirA/fileA1 ...
0
votes
0answers
36 views

use result of last line in bash [duplicate]

-> which vim /home/spo/Home/Platform/Linux/Module/Vim/Bin/vim su spo $RESULT_OF_LAST_CMD /etc/fstab What is the bash variable that holds the last commands result , like google chrome terminal . ...
18
votes
6answers
17k views

Sorting files according to size recursively

how to scan a folder recursively and find the largest files in the folder, and sort them by size. I have tried using ls -R -S but it tends to list the directories as well I need to scan the folders ...
3
votes
1answer
57 views

lshw shows a different amount of RAM than the 'free' command. Missing RAM? [closed]

Title says it all! uname -a: Linux servername 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux lshw output: *-firmware description: BIOS vendor: Dell Computer Corporation ...
0
votes
3answers
67 views

Is there something like “common Linux commands”? [duplicate]

I come from the windows world trying to switch to Linux. Sorry for the naïve question but is there something like "common Linux commands"? For example in Windows, the command line is pretty limited, ...
132
votes
5answers
23k views

I deleted /bin/rm. How do I recover it?

Just for fun, I thought I would use this command on my Raspberry Pi running Raspbian: sudo rm -f /bin/rm I thought I could just reinstall coreutils: I was wrong! apt-get install --reinstall ...
3
votes
1answer
47 views

Closing a GUI window from the command line

I often run scripts to transform a CSV file which I then preview in LibreOffice. I often open the CSV with xdg-open file.csv. However, if I run that command when the file is already open, ...
10
votes
6answers
12k views

How do I limit the number of files printed by ls?

Is there a way to limit the quantity of listed files on a ls command? I've seen: ls | head -4 but to get head to be executed I need to wait for ls to finish execution, and with directories with an ...
1
vote
5answers
8k views

checking running process

I am new babe to Linux. So please skip to read if you are not patient with begineer. Let's say I am asked to check and shut down the processes that I am not familiar with. So when I ls under bin ...
32
votes
9answers
45k views

How can I get a count of files in a directory using the command line?

I have a directory with a large number of files. I don't see a ls switch to provide the count. Is there some command line magic to get a count of files?
21
votes
7answers
4k views

how to glob every hidden file except current and parent directory [duplicate]

I want to glob every hidden file and directory, but not the current (.) and parent directory (..). I am using bash. Observe current behaviour: $ ls -a . .. ...a ...aa ..a ..aa .a .aa .aaa ...
2
votes
2answers
951 views

How to convert a group of video files using FFMPEG?

I have several video files in a directory and I want to convert all of them into other video formats. Is there any way that I can convert all of them in just one go using FFMPEG. I mean without having ...
31
votes
12answers
47k views

Efficiently delete large directory containing thousands of files

We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something ...
3
votes
1answer
14k views

access external hard drive to delete folder on terminal Mac

I want to delete a folder of portable hard drive on terminal in Mac. Are there any command line ?
2
votes
1answer
28 views

Can not access my external hard drive.

I am fairly new to Linux and have been trying to move some files around with terminal on my external hard drive but I can't seem to get it to work. I am using a generic external hard drive with a ext4 ...
4
votes
3answers
46 views

Why can't I open a shell from a pipelined process?

I've condensed my problem into the following code: #include <stdio.h> int main(){ char buffer[256]; printf("Enter input: "); scanf("%s", buffer); system("/bin/sh"); ...
3
votes
2answers
423 views

convert bulk of text files to pdf with naming based upon header file

Knowing that "How to convert from text to .pdf" is already well answered here link and here link, I am looking for something more specific: Using Claws-Mail [website] and a Plug-In [RSSyl] to read ...
0
votes
2answers
52 views

Files greater than 1 GB and older than 6 months

I want to find files which are greater than 1 GB and older than 6 months in entire server. How to write a command for this?
29
votes
6answers
5k views

How do I get a websites title using command line?

I want a command line program that prints the title of a website. For e.g.: Alan:~ titlefetcher http://www.youtube.com/watch?v=Dd7dQh8u4Hc should give: Why Are Bad Words Bad? You give it the ...
14
votes
4answers
6k views

How to kill a process with a single command?

I want to kill a process, after finding the id in a single step. I currently use these two commands: pidof <name> kill <#number_which_is_result_of_command> How can I write a single ...
-1
votes
0answers
49 views

Centos 7.0 update command not working

I have just installed CentOS 7 on my PC. After install completed I tried to update CentOS using the yum update command: Downloading packages: No Presto metadata available for base warning: ...
-1
votes
2answers
86 views

How do I get a list of all directories and files with absolute paths each line ?

Using ls -R / i get every file and directory listed that exists, but not in the desired format. What do I need to write on the command line in order to get a list in such a format, that every line ...
30
votes
5answers
40k views

Set volume from terminal

Is it possible to set the audio volume using the terminal?, instead of clicking the speaker icon in the topbar, the reason I want need to do this is because my keyboard does not have a volume ...
9
votes
8answers
15k 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 ...
5
votes
1answer
87 views

prevent multi-line paste in bash

I often use ctrl+c to copy text from some gui application and then paste it into my terminal emulator (terminator), using right-mouse-click-menu and paste. Sometimes I forget that the clipboard ...
9
votes
7answers
14k views

Getting cpu usage same every time.

When I execute following command to get cpu usage , I get nice + user cpu usage. top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}' Output: 14.5 Here I am getting problem is that the output ...