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

learn more… | top users | synonyms (1)

2
votes
0answers
109 views

Command-line file reader (like “less”) that can tell the line where the user stopped reading

[Context] I'm developing a little app, as a hobby to learn ncurses, that catalogs and lists and searches within a set of documents (for now, they are the HOWTOs from TLDP). The most tricky part of ...
1
vote
1answer
254 views

Application in terminal still running but not directly accessible [duplicate]

Possible Duplicate: How to suspend and bring a background process to foreground I have kind of an odd problem which I haven't encountered before. Here's what I did: I started an ...
6
votes
1answer
167 views

What's the difference between “command directory” and “command directory/”? [duplicate]

Possible Duplicate: When should I use a trailing slash on a directory? Does the slash make any difference?
2
votes
1answer
199 views

Does each user get his/her own tty(s)?

I put a simple echo command in a CLI tty by user1 expecting it to reach user2 who is logged in a separate tty. echo "Hello, world!" >> /dev/tty5 I expected user2 to get the echo message but ...
8
votes
3answers
893 views

Bash: Capture / Use last (or Nth) line in stdout

Query I use Bash. When I'm looking for files, often I'll do the following: find -name stackexchange.hs And often the results will look like: /youre/the/man/now/dog/stackexchange.hs ...
1
vote
0answers
433 views

Wired connection from CLI with NetworkManager - “up” in elegant way

Sometimes I need to do some operational work in text mode and I need to setup internet connection from command line (without any networkmanager applet). (Please note: that when I run Window Manager, ...
3
votes
1answer
2k views

How to change the properties of a desktop panel from the command line?

I use RHEL 6 as my regular operating system and for one of my user accounts I made one of the desktop panels as auto-hide and other as a fixed panel. I expected the hidden panel to appear above the ...
3
votes
2answers
2k views

Can the UNIX command tree display only directories matching a pattern?

I'm trying to figure out if there is a way to get the UNIX command tree to display only directories that match a specific pattern. % tree -d tstdir -P '*qm*' -L 1 tstdir |-- d1 |-- d2 |-- qm1 |-- ...
1
vote
2answers
1k views

Can the UNIX command tree display only directories matching a pattern?

I'm trying to figure out if there is a way to get the UNIX command tree to display only directories that match a specific pattern. % tree -d tstdir -P '*qm*' -L 1 tstdir |-- d1 |-- d2 |-- qm1 |-- ...
1
vote
1answer
208 views

Sed and Awk learning material [closed]

I'm looking for some learning material for sed and awk, can anyone make any suggestions? Please don’t refer to man and help pages. -O-
12
votes
5answers
2k views

How to find files with 100% NUL characters in their contents?

What is the Linux command-line command that can identify such files? AFAIK the find command (or grep) can only match a specific string inside the text file. But I want to match whole contents, i.e. ...
3
votes
4answers
15k views

Installing JDK 7 on debian

So I just rented a dedicated server running Debian, and I know nothing about Linux. Anyway, I want to install the JDK 7, first I connected through SSH and granted myself administrator rights by ...
3
votes
3answers
3k views

How can I call bc from within awk in this case?

OK, so I love my awk, but yeah, it has precision issues, and unfortunately there's no easy way for me to install the multi-precision extensions known as gawkextlib. What I am doing is, I am working ...
4
votes
1answer
1k views

Mass ID3 tag editor like vorbistagedit?

My favorite tool for batch editing of vorbis comments is vorbistagedit. I can do vorbistagedit *.ogg and it lets me edit the metadata in all my ogg files at once in my favorite editor (emacs). I'm ...
1
vote
3answers
489 views

Automatically printing images with added captions

I have a lot of scanned images and images/photos I'm working on with multiple versions. When I print them (using various programs), all I get is the image and, often, it's difficult to tell which ...
2
votes
3answers
4k views

How does the set-user-ID mechanism work in Unix?

Can someone please explain the set-user-ID mechanism in Unix ? What was the rationale behind this design decision? How is it different from effective user id mechanism ?
3
votes
1answer
1k views

Configuring Yaboot and Debian to Boot into a Command Line Login Shell?

I have a Debian Squeeze variant (MintPPC 9) installed on an old Mac Powerbook G4 (PowerPC CPU). I wish to boot it into a multiuser CLI login shell instead of automatically booting into the login ...
0
votes
2answers
84 views

Is there any way of prompt a message when a command in /usr/sbin/ is tried to run as nonroot?

In most Linux distros I've used when you type for example ifconfig as a normal user, you get a prompt message telling you that only root can execute such command. In Debian, it only says command not ...
2
votes
2answers
6k views

Get list of installed printers

Inside of a script I send a certain file to print using the lpr command on an user-selected printer. The list of the printers, from which the user selects the one to use, I get using the lpstat -a ...
5
votes
2answers
2k views

Check SMTP server capabilities on the command line

I know an SMTP server's URL. I want to know about that SMTP server's capabilities: TLS, password encryption, etc. Evolution Mail knows how to report these. How can I get them from the command line? ...
2
votes
1answer
163 views

Monitor if a running X session is idle for a while

Is there any way to monitor if a X session is inactive for i.e 10 minutes? And I would execute a command when it happens, like a screensaver, but it's not a screensaver in this case.
1
vote
1answer
257 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
533 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 ...
18
votes
2answers
86k 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
454 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
5k 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
2k 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 ...
5
votes
4answers
6k 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. ...
3
votes
1answer
504 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
4k 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 ...
11
votes
6answers
48k 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
155 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
145 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
3k 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
580 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
273 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
10k 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
5k 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
3k 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 ...