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

learn more… | top users | synonyms (1)

3
votes
3answers
2k views

How to lock on Solaris 10?

On Linux I use flock lock command to execute a command with an exclusive lock. What is the standard operating system command of Solaris 10 to do the same in a shell?
22
votes
3answers
22k views

How to copy the partition layout of a whole disk using standard tools

I want to take a backup of the whole partition layout of a hard drive, including logical drives, so that I can restore that layout to another disk. I do not want to copy the contents of the ...
6
votes
2answers
2k views

using the mail command

How do I use the mail command to check email (and send email) from gmail. Does it support labels? I couldn't have figure out where to put the username and password. I tried to search for instruction ...
1
vote
4answers
277 views

No manual page for regex in section 3 - where is it?

I found What do the numbers in a man page mean? which explains the sections for command/library documentation quite nicely, and I was looking at the output for man regex and noticed the See Also ...
4
votes
1answer
597 views

How to execute shortcut keys from command line?

I am running Gnome. I would like to execute a shortcut key combination from the command line. For example, type a command that generates the key codes for Ctrl+Alt+Left. Does anyone know of a way to ...
3
votes
2answers
2k views

Terminal command vs. GUI drag & drop when copying large no. of files: Any tangible benefit?

I'm finding myself in a terminal more and more often these days as I learn to do certain types of things quicker or more conveniently. However, when it comes to copying a large amount of data (i.e. ...
3
votes
2answers
2k views

Running C Programs on Linux

I watched a video lecture today that introduced C and things like how to make a C program that will run in Linux. I followed the steps given and now I'm stuck with a bit of a problem. I created my C ...
21
votes
5answers
14k views

Split pages in pdf

I have a scanned pdf file which has scanned two pages on one virtual page (page in pdf file). The resolution is with good quality. The problem is I have to zoom when reading and drag from left to the ...
12
votes
4answers
64k views

How to determine Linux kernel architecture?

uname -m gives i686 and uname -m gives i686 i386 output in Red Hat Enterprise Linux Server release 5.4 (Tikanga) machine. I need to install Oracle Database 10g Release 2 on that machine. So, how can I ...
7
votes
3answers
4k views

Show contents of many files

From the command line, what is the easiest way to show the contents of multiple files? My directory looks like below. ./WtCgikkCFHmmuXQXp0FkZjVrnJSU64Jb9WSyZ52b ...
1
vote
3answers
3k views

How to kill a printing job on centOS

How does one kill a printing job on centOS?
2
votes
6answers
314 views

Searching strings on files

I've got a bunch on strings which I need to find in a couple of files, for example: string1 string2 stringn file1.txt file2.txt filen.txt Is there an (easy) way to do that in bash? I need to know, ...
4
votes
3answers
3k views

Gnome Logout from command

How to get logout from Gnome session via command line ? Also Is there any way in GNOME to do "switch user" from command line ?
2
votes
1answer
372 views

Whole program name not visible in nethogs

I'm using the command sudo nethogs to watch network traffic. I have a problem in that the name of the program is too long (it doesn't fit in the PROGRAM column). I haven't found any nethogs ...
1
vote
0answers
329 views

How can I automount devices with no desktop environment? [duplicate]

Possible Duplicate: Replacement for halevt? I've installed Arch Linux on my computer and I'm not using a desktop environment. I just have Openbox window manager installed and bit by bit ...
6
votes
3answers
1k views

Print an SVG from the command line

How can I print an SVG, already scaled to a4 size, from the command line? I tried using lpr, but instead the printer just printed out the actual XML of the file, which isn't what I wanted.
4
votes
1answer
2k views

Resizing and croping images to an aspect ratio of 6x4 with width of 1024 pixels

I have a mixed set of images, each one has a slightly different resolution with a slightly different aspect ratio from other images. I have tried using commands like convert -resize and convert ...
15
votes
1answer
7k views

What do double slashes mean in UNIX path? Is `cd dir/subdir//` valid? [duplicate]

Possible Duplicate: How linux handles multiple path separators (/home////username///file) Do cd dir/subdir/ and cd dir/subdir// mean the same in UNIX? Will the later work out? Else does ...
1
vote
1answer
660 views

Execute a command in a different path

When using Git VCS, I execute all of the git commands on the directory that contains a .git repository. I want to execute a git-pull through an SSH trigger but how do I define the path to the ...
7
votes
2answers
698 views

What is a good way of saying “run this after 15 minutes” on a shell?

I use this sleep 900; <command> on my shell. Just wanted to know is there is some alternate/better way that you use?
3
votes
4answers
495 views

Send file to opened editor using command line

Recently I found out a new very useful command. It is: gnome-open or xdg-open or just open on mac. It opens file or directory in by default specified program. But, in the event ...
17
votes
2answers
6k views

Is it possible to save as sudo from nano after you've forgotten to run as sudo?

A lot of the time I edit a file with nano, try to save and get a permission error because I forgot to run it as sudo. Is there some quick way I can become sudo without having to re-open and re-edit ...
8
votes
4answers
14k views

pdf to jpg without quality loss; gscan2pdf

When I convert a pdf file to bunch of jpg files using convert -quality 100 file.pdf page_%04d.jpg I have appreciable quality loss. However if I do the following, there is no (noticeable) quality ...
19
votes
4answers
960 views

What should I use when cut doesn't cut it?

I have a file cities like this: [1598] San Diego, US (inactive) [4517] St Louis, US (inactive) [6346] Orlando, US (inactive) I want to cut out the city names, so that I have: San Diego St Louis ...
5
votes
2answers
372 views

Workings of top and ps commands

How do the commands top and ps calculate CPU utilization using the /proc/[$pid]/stat file? Also how do they obtain memory utilization information about the process?
1
vote
1answer
242 views

Pressing `up` to get the previous command in a tty on Ubuntu Server

I've installed Ubuntu Server 10.10, and when I press up in a terminal nothing happens. Using Ubuntu Desktop it gave me the previous command that I ran. How can I make it do this in Ubuntu Server as ...
73
votes
2answers
18k views

What does “--” (double-dash) mean? (also known as “bare double dash”)

I have seen -- used in the compgen command. For example: compgen -W "foo bar baz" -- b What is the meaning of the --.
31
votes
7answers
5k views

Linux tools to treat files as sets and perform set operations on them

Does anyone know of any linux tool specifically designed to treat files as sets and perform set operations on them? Like difference, intersection, etc?
7
votes
2answers
356 views

Command-line software for playlist syncing to Android Phone?

I'm looking for a way to sync music to my Android Phone without having to load something like banshee. I know there are plenty of ways to sync files, but I'm interested in syncing playlists and having ...
13
votes
7answers
7k views

diff within a line

I have some sql dumps that I am looking at the differences between. diff can obviously show me the difference between two lines, but I'm driving myself nuts trying to find which values in the long ...
1
vote
5answers
224 views

What horrible mistakes should I avoid as a newb? [closed]

Edit - please see this duplicate question. I just chowned -R my /usr folder, which totally corrupted my computer (not sure how, but I lost sudo power eventually). This seems like a horrible newb ...
3
votes
1answer
385 views

Multiple renaming files [duplicate]

Possible Duplicate: How to clean up file extensions? I'd like to rename files with extension .flac.mp3 to extension .mp3. I used the following command $ for i in *; do mv $i `echo $i | sed ...
3
votes
2answers
629 views

How do I execute a script later?

I need to compile gcc45 on my computer and that's a lengthy and resource-intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to: $ ...
3
votes
1answer
226 views

ssh behavior for root and non-root user

When I ssh as root to a remote machine, the command output looks like this: root@Machine:/current/path#: However, if it's a non-root user, all I see is: $ How can I get the same behavior as for ...
8
votes
7answers
10k 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 ...
24
votes
6answers
28k views

Where do files go when the rm command is issued?

Recently I accidentally did rm on a set of files and it got me thinking where exactly these files end up? That is to say, when working with a GUI, deleted files go to the Trash. What's the equivalent ...
7
votes
2answers
4k views

Reading from a continuously changing logfile [duplicate]

There is /location/of/thefile, which is a continuously changing logfile. The average density of refreshes is 4 per minute, the possible maximal refresh rate could be 30-40 per minute. Every refresh ...
56
votes
9answers
2k views

Remember a half-typed command while I check something

I often find myself in the following position: I've started typing a long command at the bash prompt, but half-way through I find out I need to check something with another command. This is a problem ...
12
votes
2answers
2k views

Where do my ANSI escape codes go when I pipe to another process? Can I keep them?

I sometime want to pipe the color-coded output fror a process, eg. grep... but when I pipe it to another process, eg. sed, the color codes are lost... Is the some way to keep thes codes intact ? ...
3
votes
2answers
429 views

Change the time format for the touch command in BSD

I am wondering how to change the time format when I am modifying a time with the touch command in the c shell. For example I need to use touch -a -t 051512002015 file.txt This will change the ...
25
votes
4answers
17k views

What is the mknod command used for?

I just started using Ubuntu as my main OS and I wanted to learn about things I should not do, and learn by the bad things people have done in the past. I came across these email about horror stories ...
3
votes
4answers
1k views

How to get size of a block special file?

I need to be able to determine the size of a block special file. For example, given /dev/sda, I need a command that will provide the size of the device. (By size I mean capacity, since this is a ...
3
votes
2answers
602 views

Oneliner for slicing an image?

I'm looking for a oneliner command that would slice an image into given proportions. Say input would be filename and slice dimensions. Are there any standard command-line tools for this? I tried ...
3
votes
0answers
168 views

How to copy a long textfile to clipboard on gnome-terminal? [duplicate]

Possible Duplicate: How do I send stdin to the clipboard? What's the best way to copy a long text file to keyboard? I'm imagining something like: cat longTextFile | straightToClipboard
2
votes
0answers
149 views

Execute command when file changes [duplicate]

Possible Duplicate: Can a bash script be hooked to a file? Hi there, I am trying to execute a command every time a file changes. Is this possible? I think there is some way to watch for a ...
1
vote
3answers
450 views

Cannot access network on the command line in Ubuntu 10.04

I am having an issue which I am unable to diagnose. I am unable to access outside the local network from the command line. Strangely, ftp works from the command line. But ping, links, traceroute, wget ...
21
votes
9answers
7k views

How do I split a flac with a cue?

I've got a full album flac, and a cue file for it. How can I split this into a flac per track. I'm a KDE user, so I would prefer a KDE/QT way, I would like to see command line and other gui answer's ...
-1
votes
2answers
261 views

CentOS command issue

This is what I am trying to run in VMware using CentOS 5 /pwnat: invalid option -- p usage: ./pwnat <-s | -c> <args> -c client mode (default) <args>: [local ip] ...
5
votes
2answers
3k views

What params do I pass to grep to return only file names?

I'm trying to use grep to find a specific piece of text in a bunch of files on my web server. No problem, except that it returns way more information than I want! Ideally it would just return a list ...
6
votes
1answer
1k views

How can I clear the list of recently accessed documents in Fedora?

When I click on the Clear recent documents item in the GNOME menu, it clears the list of recently used documents (as expected). How can I replicate this functionality from the command line?