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

learn more… | top users | synonyms (1)

1
vote
1answer
186 views

Display words in color

I am looking for a tool which takes a file in input and a word to search. It should display the file with color the words if it corresponds to the search. Like grep --colors but displays all the ...
3
votes
1answer
393 views

How to get bash to suggest a missing package?

While running Ubuntu, while trying to execute a commmand in bash, it used to suggest that the said program was missing but found in another package Y, and that I could try installing it. Now on a ...
6
votes
2answers
30k views

Zip all files in directory?

Is there a way to zip all files in a given directory with the zip command? I've heard of using *.*, but I want it to work for extensionless files, too.
2
votes
1answer
321 views

Is there a way of color-highlighting paired brackets in shell (bash)?

Does anyone know if there is a way reproducing the same behaviour many text editors provide for colour-highlighting the syntax operators such as brackets or curly brackets. It would be very useful for ...
1
vote
3answers
3k views

How to run the most recent command on AIX?

How can I run the most recent command again from history in AIX Server? And how to edit the most recent command and run it again in AIX?
3
votes
1answer
1k views

xargs : using same argument in multiple commands

Am trying to write a one-liner that can probe the output of df -h and alert when one of the partitions is out [or almost] of space. It's the part using xargs that kicking me in the ass now... echo 95 ...
4
votes
4answers
3k views

How to exit sh program?

I bungled the commands and wrote sh -man Now I've entered a program called sh-3.2 that is seemingly impossible to exit. Ctrlc,Ctrlz, or Ctrlxdoes not work. exit, quit, q, :q also does not work. ...
2
votes
1answer
409 views

Make stdout and stderr be buffered by the same buffer

Is it possible to force glibc to use the same buffer for stdout and stderr? If I tee the both outputs: ./tests/tests 2>&1 | tee log I get mixed messages (i.e. messages are ordered inside ...
2
votes
2answers
538 views

Sort the output of find before piping to openssh

I'm using this command to recursively generate a SHA-512 hash for each file in a directory hierarchy: find . -type f -exec openssl sha512 {} \; I'd like to sort the files in lexicographical order ...
0
votes
2answers
2k views

“system-config-network-tui &” doesn't work

When I try to edit or assign the IP using this command: system-config-network-tui & Terminal opens a console which is uncontrollable, just like this: This happens on CentOS and Red Hat.
2
votes
0answers
2k views

How can I connect to a wireless network with hidden SSID using the terminal? [closed]

I'm starting to learn about wireless pentesting with BackTrack, and while learning how to find out the hidden SSID I wondered how could I connect to the wireless network after I discover the SSID. The ...
7
votes
5answers
26k views

How can I monitor all outgoing requests/connections from my machine?

My machine is a server so I want to ignore connections being made to my server (e.g. when someone visits my website). I want to see only connections/requests being made by my server to other places. ...
7
votes
6answers
1k views

Colourful terminal or console?

I love colors in my console, and I wonder if there is any way to get a terminal (I guess only a software is able to do that) printing almost everything in colors. Of course there is the --color=auto ...
9
votes
2answers
964 views

Command line prediction

I've found an interesting paper: Predicting UNIX Command Lines about command-line prediction (based on user past activity), and I wonder if any actual implementation of such thing exists?
1
vote
1answer
146 views

What's the essential difference between grep foo $(CMD) and CMD | grep foo

It's really important because intuitively they are all similar for me. Could one realise that those two are really like one another for me, i.e. absolutely equal?
2
votes
2answers
134 views

Zipping files two by two

I have a directory that has 800 files like this: file1.png file1@2x.png file2.png file2@2x.png file3.png file3@2x.png ... etc I need to create zip files like this file1.zip (containing ...
3
votes
1answer
2k views

Extrat tar “Cannot open: File name too long”

I made a tar with a directory on a remote machine with: tar -czvf I scp it to my local machine, where I wanted to untar it: tar -xzvf But I get : Cannot open: File name too long On my local ...
4
votes
4answers
1k views

Pipe the output of a command to rm command

Following command prints the path of the song being played. mpc | head -n 1 songs/oldSongs/Mukesh_D/041 KANHAIYA = YAAD AAYI ADHI RAAT KO.mp3 Can I delete this file by modifying the command I used ...
0
votes
1answer
2k views

Uncompress txt.gz files [closed]

Trying to uncompress txt.gz files on Linux. gzip, gunzip, unzip are not recognizing the file format. The archive is guaranteed to be not corrupted.
15
votes
1answer
459 views

Make program first read from pipe, then from keyboard

Consider the interactive program interactive. I have to run this program fairly frequently, and each time I run it the first few commands are the same. Obviously, having to type those commands over ...
5
votes
2answers
246 views

Why arguments in braces do not expand in this case?

For example, I want to put some file names inside braces for expansion like this: $ ls blue_texture blue_waves green_light $ ls -m | tr -d ' \n' blue_texture,blue_waves,green_light $ echo ...
3
votes
4answers
7k views

CentOS 6 - nameserver entry in resolve.conf resetting after restarting network services?

In /etc/resolv.conf, I've changed the nameserver line to a new IP address. After saving and exiting, I run service network restart. I then go open /etc/resolve.conf again and see that the IP address ...
17
votes
3answers
4k views

echo a file without the first and last lines

Is there a simple way I can echo a file, skipping the first and last lines? I was looking at piping from head into tail, but for those it seems like I would have to know the total lines from the ...
2
votes
2answers
1k views

Concatenate multiple files under subdirectories

My directory structure is given below x:\Project_2012-158A\Sample_4041 SampleSheet.csv 4041_CGTACG_L002_R1_001.fastq 4041_CGTACG_L002_R2_001.fastq 4041_CGTACG_L006_R2_001.fastq ...
0
votes
2answers
2k views

How to add an IP to hostname file

I have a Centos 5.8 server. How can I add my server IP address 192.168.20.254 so that it reflects when I run the command hostname -i At the moment the command only shows the loopback IP 127.0.0.1 and ...
1
vote
1answer
129 views

questions on find and grep

With respect to the following find command-line find . -type f -exec grep -l strings {} \; I do not understand the usage of -exec and {} \.
4
votes
4answers
2k views

Find largest files recursively

There seem to be a lot of entries about how to use du to recursively find the largest dir and files at the same time, but none on how to only recursively find the largest files in a set of ...
1
vote
5answers
1k views

Checking if a file exists in several directories

I've been working on this far too long and need some help. I need a script that will look at files in a directory and see if it exists in one of several directories. I need something like this: for ...
2
votes
1answer
126 views

Running a program automatically?

There is a Linux program I like which is Conky, when I run conky -c mycustomconf.txt it runs fine. I want this program to run automatically when I start my computer, without having to type in the ...
2
votes
2answers
373 views

How to stop a infinite running process (ztail) started by a ssh session after that session is closed

I have a peculiar problem. My server supports multiple ssh session simultaneously, so that multiple admins can manage (via command line interface) it simultaneously. We have a command which calls ...
3
votes
2answers
11k views

No network connection in CentOS 6.3 Minimal under VMWare Player

I'm trying to replicate in VMWare Player the exact same conditions I have under my Dedicated Server for testing purposes. Now, the thing is that that when I try to install something, or ping ...
2
votes
1answer
2k views

Edit a file on CentOS 6.3 Minimal

I installed CentOS 6.3 Minimal on VMWare Player, and I realized how 'minimal' the setup is... Don't have network connectivity. From what I searched on google, I need to edit the file ...
3
votes
1answer
394 views

How to undo in spreadsheet calculator sc?

spreadsheet calculator sc is a very old console-based program. It does what the name says. I cannot find how to undo an operation in its man page. I currently use it together with RCS, ie. manually ...
3
votes
2answers
1k views

Getting linux webcam state via command line or API

I would, preferably, like to know of a command I can run that will let me know whether a webcam is on/off or recording/not recording, etc. Maybe a way to see if any programs are currently accessing it ...
1
vote
0answers
86 views

Running Tomcat MySQL and Apache under a group

I am trying to set up a web server at home using Ubuntu, but prefer my bash scripts to be platform agnostic hence why I am asking here. I also dislike apt-get everything. I am trying to create a ...
14
votes
2answers
1k views

Copying files from command line to clipboard

In a GUI file manager it is possible to select a few files, press Ctrl-C (which supposedly copies come info about the files to clipboard), then navigate to another folder and press Ctrl-V, which will ...
1
vote
1answer
149 views

Right way to start VirtualBox with shared folders mounted

Need of commandline to start VM with access to shared folder. Now if I run /usr/lib/virtualbox/VirtualBox --comment "win" --startvm "c252555c-bla-bla" I get VM running but shared folders not ...
9
votes
4answers
3k views

Remove all `at` jobs

I know that to remove a scheduled at job I have to use atrm "numjob1 numjob2", but is there an easy way to do that for all the jobs?
2
votes
1answer
68 views

Changing compression in memory

I have some large files that I need to change the compression type of for input to a program--I need to unrar them and then gzip (or bzip2) them. However, they're highly compressed files and I don't ...
3
votes
3answers
637 views

Copy multiple files to one dir with parallel

I'm using the following script to copy multiple files into one folder: { echo $BASE1; echo $BASE2; echo $BASE3; } | parallel cp -a {} $DEST Is there any way to use only one echo $BASE with brace ...
4
votes
5answers
3k views

How to enclose in quotes if both single and double quotes are already used?

I don't remember the exact commands and tricks that I use sometimes which solves much of the work, so I try to log them into a file for future reference. What I typically do is just put whole command ...
3
votes
2answers
6k views

xmllint display values of more than 1 attributes in single execution

I am using xmllint to parse xml file which has several tags and each tag has several attributes. Sample structure as shown below: <root> <child attr1="abc" attr2="def" attr3="ghi" /> ...
1
vote
1answer
219 views

Combining files with 4 columns each, into 4 files for each column [closed]

So I have a bunch of text files which look like this: T1 r1 a b c d r2 d e f g ... T2 r1 h i j k r2 l m n o ... And I want to make FOUR different text files in the following ...
-1
votes
1answer
107 views

Why do many CLI apps take a single “--” argument? [duplicate]

Possible Duplicate: What does “--” (double-dash) mean? There are many command line tools that take a single "--" argument. For example: gem install mysql -- ...
7
votes
2answers
2k views

What does “--” mean in Linux/Unix command line? [duplicate]

Possible Duplicate: What does “--” (double-dash) mean? git diff [options] [<commit>] [--] [<path>…] In here, how should I understand what [--] means? And when should I use it.
2
votes
2answers
677 views

Bandwith monitoring in Linux

I just need to get how much bandwidth is used in 3 or 4 days. Do you have any application in the terminal to do it? I'd prefer if it didn't use SNMP. I found iptraf, wireshark, cacti, but they were ...
2
votes
2answers
2k views

How to fix Linux filename tab autocomplete that is appending a space instead of trailing slash on directories?

For some strange reason my filename autocomplete is behaving differently than normal. Given the following file structure ./foobar/file.txt, if I want to delete file.txt, I type rm ...
3
votes
1answer
312 views

Display the command being executing currently

I don't recall to have explicitly placed anything in my .bashrc file recently, but from yesterday I am able to see the command being displayed at the prompt before getting executed. I don't know how ...
1
vote
2answers
576 views

ps aux |grep 'asdf' grep: asdf: No such file or directory

For some reason a while back, the behavior of my command line changed, and I don't know why. Using OSX, now Mountain Lion(although this behavior was present before the switch). Using standard ...
0
votes
2answers
161 views

sqlite fts quoting problem

I can do this in sqlite tool: sqlite> select caption from notes_fts where notes_fts MATCH '"perl install"'; but cannot from the Linux shell i.e., this fails: user@host:~$ sqlite3 sqldb ...