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

learn more… | top users | synonyms (1)

9
votes
4answers
55k 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
3k 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
281 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
2k 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
350 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
6k 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
530 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
648 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
466 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 ...
15
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
12k 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
884 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
368 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
235 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 ...
63
votes
2answers
16k 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
4k 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
339 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
6k 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
217 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
347 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
571 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
224 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
6answers
8k 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 ...
23
votes
6answers
24k 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
3k 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 ...
55
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
380 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 ...
24
votes
4answers
14k 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
583 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
440 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 ...
20
votes
8answers
6k 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
255 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 ...
5
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?
2
votes
1answer
646 views

Can I redirect stdout from a background application after starting it? [duplicate]

Possible Duplicate: redirect output of a running program to /dev/null Is it possible to change stdout after starting something as a background application in the command line? Say I run ...
2
votes
3answers
2k views

Printing unique lines

Is there some better solution for printing unique lines other than a combination of sort and uniq?
29
votes
6answers
51k views

How to overwrite target files with mv?

I have a ton of files and dirs in a subdirectory I want to move to the parent directory. There are already some files and dirs in the target directory which need to be overwritten. Files that are only ...
5
votes
3answers
5k views

How to cd to a Windows file share?

At work, I spend a lot of time manipulating files on a networked computer that's running SME Server (but that's set up for Windows filesharing, if that somehow makes a difference). I have been ...
3
votes
2answers
348 views

Drawing a state machine from logs

I have logs in the following format: 03/22/2011 14:45:06;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35707.arien.ics.muni.cz state from EXITING-RETURNSTD to EXITING-STAGEOUT (5-51) ...
6
votes
4answers
5k views

All commands that should be used to connect to wifi in command line

I would like to switch from gnome to awesome and I would like to connect my wifi network in command line (instead of using gnome tools). So, I searched on the internet and found approximatively the ...
2
votes
3answers
525 views

Selective recursive move?

Is there a command like mv --preserve-structure src src/1 src/2/3 dst which creates dst/1 and dst/2/3? It should work similar to mv src/* dst, but move only the subtrees listed.
9
votes
2answers
936 views

What does “-” mean as an argument to a command?

I found this link on how to open tgz in one step. gzip -dc target.tar.gz | tar xf - What does the '-' mean?