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

learn more… | top users | synonyms (1)

3
votes
1answer
531 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
1k 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
5k 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
3k 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 ...
12
votes
6answers
53k 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. ...
8
votes
6answers
2k 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 ...
10
votes
2answers
1k 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
159 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
148 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
3k 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
2k 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 ...
1
vote
1answer
4k 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
603 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
289 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
9k 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 ...
21
votes
5answers
11k 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
2k 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
6k 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 ...
2
votes
1answer
135 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 {} \.
5
votes
4answers
4k 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
2k 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
130 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
498 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 ...
4
votes
2answers
13k 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
3k 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
3answers
560 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 ...
4
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
92 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
2k 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
156 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 ...
13
votes
4answers
6k 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
75 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
2answers
974 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
4k 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
9k 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
255 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
116 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
3k 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
729 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
363 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
699 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
196 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 ...
3
votes
1answer
939 views

How to switch PulseAudio inputs and outputs from command line?

At work I use to use an USB headset which gets detected as separate audio output and input (for the mic) devices. At home I use conventional analogue headset which is plugged into my laptop built-in ...
5
votes
1answer
714 views

RIPEMD-160 file digest

How can I make a file digest under Linux with the RIPEMD-160 hash function, from the command line?
8
votes
2answers
492 views

Command line input while a running script displays strange symbols

If I use the bash shell cli and run some program which doesn't return immediately, then I input some letters (basically typing the next command before noticing the previous didn't finish) and the ...
2
votes
3answers
304 views

How to echo (a (executable-)string) to the prompt, so that the cursor flashes at the end of the line?

How to echo (a (executable-)string) to the prompt to make the cursor sit at the end of the line? So that I can hit Enter to execute or Ctrl-C to throw away the line. Is this possible at all? I ...
3
votes
2answers
4k views

How do you configure the MTU for all network adapters via a script?

NOTE: This is for RHEL/centOS. Currently my way of configuring the MTU is via GUI using system-config-network and setting the MTU to 4096. I would like a non-interactive script to do this instead. ...
2
votes
1answer
511 views

How to make FreeBSD variant of cal start weeks on mondays?

Can week start day be changed in cal output? Is it hardcoded? Notice: not the ncal.
0
votes
1answer
417 views

rexecd daemon for Ubuntu

How to start rexecd daemon/server on ubuntu-11.10 ? If I try to run the command /usr/sbin/in.rexecd then an error appears as rexecd: getpeername: Socket operation on non-socket rexecd is remote ...