A shell is software that lets users interact with the operating system, usually by typing at a command-line.

learn more… | top users | synonyms

9
votes
11answers
10k views

how to `tail` the latest file in a directory

In shell, how can I tail the latest file created in a directory?
14
votes
4answers
3k views

A command before every bash command

Does anyone know a mean of putting a 'time' command before every command in a bash session?
0
votes
2answers
874 views

How to repeat commands from history in ksh vi-mode

Say I have a hundred commands in my shell's history, and now I'd like to repeat commands 74 through 78. In the emacs mode of bash/ksh/zsh, I would navigate back to command 74 then hit Control-O on ...
18
votes
8answers
39k views

How to resume CUPS printer from command line?

I have printer in CUPS that due to driver problems (HP 1010) from time to time goes into pause. I would like to write a shell script that will execute once per hour to resume a printer in CUPS. But ...
7
votes
2answers
7k views

How do I create a shortcut that opens Cygwin bash shell on a directory of my choosing (UNC especially)?

Given a standard installation of Cygwin for Windows XP, I would like to create a standard Explorer shortcut that opens a bash shell already open on a directory of my choosing. The directory is a UNC ...
4
votes
3answers
101 views

improve man page search

There is one little thing annoying me in man pages. When I search for text using '/' command the line where the text is found is positioned at the top of the screen. I find it inconvenient because ...
11
votes
5answers
15k views

Is there a way to escape single-quotes in the shell?

E. g. I want to say perl -e 'print '"'"'Hello, world!'"'"', "\n";' Is there a less awkward way to do it, e. g. escaping single-quotes? Yes, I know that I can write perl -e 'print q[Hello, ...
3
votes
3answers
3k views

How to store a Unix alias?

I know I can create an alias for untar like this alias untar=’tar -xvzf’ How do I make this persist from session to session, because it seems it is lost when I reconnect?
7
votes
4answers
474 views

Documenting Unix commands on the command line

I would like to append both the last command and the output of the last command to a text file for the purpose of a tutorial. For example: After I do an ls in my home directory I see this on the ...
0
votes
4answers
302 views

need advise on using sort command in Linux

How to sort a file using sort command.. I would like to sort the file based on 2nd field which is seperated by "," as a delimiter Ex: filename1, 465, output_file1, filename2, 300, output_file2, ...
22
votes
9answers
87k views

What is the shell command to display contents of a file?

Like that of .txt or .html
4
votes
4answers
4k views

How do I “globalize” binaries in Linux?

For example, any binary placed in /usr/local/bin will run in any location. If I were to place binaries inside /myname/local/bin how would I be able to accomplish the same thing?
26
votes
4answers
31k views

Delete matching files in all subdirectories

How can I remove all .swp files in all of my subdirectories under Linux?
0
votes
0answers
172 views

How can I get Linux to interpret keyboard characters properly? [duplicate]

Possible Duplicate: How to configure PuTTY so that Home/End/PgUp/PgDn work properly in bash? I access a linux server shell via putty, but many of the keys I use do not translate across, up, ...
1
vote
4answers
3k views

How can I get Linux to interpret keyboard charaters properly?

I access a linux server shell via putty, but many of the keys I use do not translate across, up, down, left and right all are seen as ^[[A, ^[[B, ^[[D and ^[[C; But so is C-up, C-down, C-left and ...
2
votes
3answers
256 views

What part of man pages apply to the bash shell?

I am currently using the bash shell but am a bit confused about man entries. For example the man entry for source (man source): DESCRIPTION sh The exec command specified by the arguments is ...
3
votes
4answers
1k views

Is there a way I can use $PATH as defined by my bash profile?

I spend most of my day ssh'd into servers. I have a series of aliases/functions/scripts that allow me to type p hostname from the terminal and execute GNU screen(1) on the remote side, using the ...
20
votes
3answers
9k views

Random password generator: many, in columns, on command line, in Linux

A while back, I came across a random password generator for the command line that displayed a grid of "memorable" passwords. Output was something like this: adam@host:~$ CantRememberThisCommand ...
5
votes
4answers
14k views

How do you replace the logon shell with iexplore?

This is related to my previous question. Apparently I didn't know what I thought I knew.. Like said in my last post, I am looking to make a kiosk where when it starts up, it goes straight into ...
1
vote
1answer
928 views

Why are some files in ls -l on Mac OSX (Snow Leopard) tagged with “@”? [duplicate]

Possible Duplicate: What does the @ in ls -al mean? When doing an ls -l some files are tagged with "@" like this: -rw-r--r--@ 1 master staff 2074042 Feb 3 19:26 ...
1
vote
3answers
143 views

Search and replace /'s in VI

I was wondering how I would search and replace all /'s with -'s in vi. %s///-/g doesn't work obviously.
3
votes
4answers
3k views

Why does \rm work but rm doesn't?

Usually whenever I remove directories, "rm -rf " works. But sometimes I get this response: "rm: examine files in directory / (yes/no)?" Then I try "\rm -rf ", and that works. Can anyone explain why? ...
4
votes
4answers
7k views

Under Ubuntu, how can I place a shell alias command that will be global to everyone?

Under Ubuntu 9.10, where can I place an alias command that will be valid to all users, root or otherwise, and that will work with a shell under GNOME as well as an ssh session and plain console login ...
14
votes
5answers
9k views

Linux Shell: Copy output into clipboard w/o using the Mouse?

Is it possible to copy the output into the clipboard without using the mouse? For example, I would like to do something like this: $ pwd >> clipboard
7
votes
2answers
4k views

Is it possible to set wget to show the transfer times in milliseconds?

Generally, wget shows transfer times in seconds. Is there a way I can to make it show the time in milliseconds?
10
votes
4answers
7k views

Better way to do “echo $x | sed …” and “echo $x | grep …”

I often find this in scripts (and, I have to admit, write it myself): a=`echo $x | sed "s/foo/bar/"` or if echo $x | grep foo then ... fi Consider "foo" to include some regex stuff. I feel ...
2
votes
3answers
4k views

How do I change my default shell to use ZSH in Ubuntu? [duplicate]

Possible Duplicate: How do I make Bash my default shell on Ubuntu? I want to change my default shell in Ubuntu to ZSH. What's the command to do this?
3
votes
4answers
249 views

Is 'more' dead on OS X?

Just when I was getting curious about less vs. more I am running Snow Leopard. When I type more it says Missing filename ("less --help" for help) So I type whereis more and it says /usr/bin/more. ...
4
votes
1answer
1k views

emacs as a pager?

I am looking for a way to use emacs as my pager command in the shell (for example with man or to scroll the output of an asynchronous command with a large amount of output). I use emacsclient as my ...
15
votes
2answers
5k views

Putty SSH: CTRL+Cursor keys don't work skip to previous/next word

When I am connected to my local Ubuntu dev server with putty (from my Windows 7 box) via SSH, the following key combinations don't work to move the cursor forward and backward on word boundaries: ...
0
votes
2answers
167 views

Existence of USER environment variable in the shell

I heard (although I can't find any sources for proof) that the USER environment variable may not be set in a old Unix shells (maybe even some obscure shells as well). What is the probability that it ...
3
votes
1answer
417 views

Change priorities of ALL processes

I know that you can modify the nice value of a particular process as follows: renice 19 -p 4567 However, now I would be interested to set the renice value of ALL active processes. I am coming from ...
0
votes
2answers
340 views

how make a alias mixing with clearcase command and shell command

I make a alias like : alias a 'ct setview myview ; cd /vobs/project/foo' but this alias just partly works : it can set view , but it does not take me to /vobs/project/foo . so could you tell me ...
0
votes
2answers
610 views

Linux rename using parameters and spaces?

Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing: mkdir "new dir" and: touch ...
2
votes
4answers
2k views

How to moves files two directories up using ssh?

I am able to move files one directory up by using the following command: mv * .. but is there a way to move files two directories up?
1
vote
4answers
1k views

Shell environment for su

I have some aliases and modifications to ls that I'd like available at all times. Is it possible to set environment variables for use when I am logged in as root after I sudo up with sudo su?
7
votes
8answers
3k views

Ending a process in unix instead of interrupting it

At the unix command line if i press Ctrl-C,that does not end a process but rather interrupts it and i return to the shell prompt. So,i have the following two questions: 1.Is there a way i can see the ...
2
votes
6answers
596 views

md5 hash is different on a file split, cat back again

Here's an excerpt of the commands I ran as I split and then cat a file: sh-3.2# split -b 600m bt4-final.iso sh-3.2# ls -hal total 6132096 drwxr-xr-x 6 root staff 204B Jan 12 19:59 . ...
0
votes
2answers
132 views

forwarding /var/usr/emails/dave to other emails

I'm new to openSuse 11.1, I have several crontab jobs running, one of which creates a dynamic list of 'at' jobs each day. I've noticed every time one of the 'at' jobs finish, an email is sent to ...
3
votes
4answers
2k views

GNU find with -exec rm removes matches, then complains they don't exist

I have a /domains directory in which I have entries such as theawesomesite.com 0.2.v.theawesomesite.com 0.3.v.theawesomesite.com And after testing 0.3, I'll set the main domain to alias the new ...
3
votes
5answers
932 views

Shell: Is it possible reference previous parameter?

Is it possible to run consecutive commands, with those that follow referencing the parameter(s) passed to the very first? For example, download, untar, and cd: wget superuser.tar.gz tar -xzf ...
1
vote
1answer
592 views

How do I run gvim within the same shell window?

I'm running gvim on my mac from /usr/local/bin. If I invoke it from a terminal window it opens it up in a new window. I'd like to get it to just run in the same window I'm already using. How do I ...
240
votes
7answers
156k views

How to chmod 755 all directories but no file (recursively)?

How to chmod 755 all directories but no file (recursively) ? Inversely, how to chmod only files (recursively) but no directory ?
4
votes
2answers
670 views

How do I get bash to respect my physical directory structure? (And likewise for Emacs?)

If in bash, I do "set -P" then bash follows the "physical directory structure" when doing "pwd" and "cd .." etc, rather than the "logical one" that might be defined via symlinks. Unfortunately, bash ...
8
votes
4answers
2k views

How long is long for the Unix 'file' command?

When you pass a text file to the Unix file command, it might tell you something like: input.txt: UTF-8 Unicode English text, with very long lines Can somebody tell me the minimum number of ...
0
votes
2answers
935 views

linux: monitoring tty1 in graphical display

I'm wondering if this is possible: I have stuff happening in TTY1 (i.e. the big console I get by hitting ctrl-alt-F1), and if at all possible I'd like to "watch" it in some way from my graphical ...
5
votes
4answers
2k views

Does “chmod 777 .* -R” chmod parent directories (..)?

Does chmod 777 .* -R change the mode of parent directories (..) recursively?
51
votes
2answers
9k views

Case insensitive tab completion in Bash

Is there any way to make Bash tab complete case insensitively? $ bash --version GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0) Copyright (C) 2007 Free Software Foundation, Inc. I am ...
0
votes
2answers
242 views

Shell not finding binary when attempting to execute it (it's _definitely_ there)

I have a specific set of binaries installed at: ~/.GutenMark/binary/<binaries...> These were previously working correctly, but for seemingly no reason when I attempt to execute them the shell ...
2
votes
2answers
269 views

tips about easy alternative/management of PATH in windows

I come from Linux where I'm used to the fact that most applications install to /usr/bin and my tools I put in ~/bin. This means I rarely need to modify the PATH variable. Since I work as a ...