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

learn more… | top users | synonyms

5
votes
2answers
7k views

How do you change the default TERM value set at console login (Ubuntu)?

The $TERM shell value in Ubuntu defaults to "xterm" for a console login. How can I change it so it defaults to "xterm-color"? I'm asking because it looks like this is the easiest way to turn-on the ...
2
votes
2answers
1k views

How to Detect that Current (Bash) Shell is a (Vi/Vim) Subshell?

From inside Vi/Vim, I can type: :shell to drop into a shell. Is there any way to detect that I am in a Vi-spawned subshell? The environmental variable SHLVL is 2, but that does not tell me ...
1
vote
2answers
622 views

split command on Ubuntu command-line

I want to split a file into multiple files with at most 25 lines each. I'm using this: split -l 25 /etc/adduser.conf > /home/ubuntu/PL/trab3/rc_ But I do not get the files I expect. How can I ...
1
vote
2answers
423 views

Symlinks are inaccessible by their full path on OS X

I have symlinks pointing to applications placed in /usr/local/bin which is in the path. However, I can't run these applications from other folders. Even more weird, I can't access them by the full ...
2
votes
3answers
6k views

How are Linux environment variables DISPLAY and XAUTHORITY used?

How are these 2 variables used by the X Window system? On my Ubuntu 9.10 host, if I set XAUTHORITY to anything and then try to run a GUI program, I receive a GTK-WARNING ***: cannot open display ...
1
vote
1answer
1k views

Why can't my .cshrc file be sourced automatically?

When I SSH to a certain Linux host, although my default shell is tcsh, the .cshrc file under my home directory is not sourced at all. I can't understand why this happens because from my understanding, ...
6
votes
6answers
2k views

What are the common Control combinations in a terminal setting

I would like to have a good guide to the common Control key combinations in use in bash (and similar) shells and the combinations used by common programs in use in those shells. My particular ...
6
votes
1answer
24k views

Bash & 'su' script giving an error “standard in must be a tty”

Folks, I'm having an issue with a bash script which runs a particular command as a different user. The background: Running on a Linux box (CentOS), the script is quite simple, it's starting the ...
36
votes
3answers
56k views

How can I change shell in Ubuntu? [duplicate]

I have a Ubuntu Server VPS and I want to use /bin/bash/ as my shell. How can I change my shell? I have root access but I don't work as root. So dash is my default shell now. I have read How do I make ...
4
votes
1answer
1k views

Shell scripting: Way to parse parameters from command line

myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are ...
0
votes
3answers
254 views

How to use sed or AWK to separate a string (NOT string in files)

How can I separate .sh files into a list? I have tried: ls *.sh | xargs sed 's/\n/ /g' > out.txt The return of ls *.sh is a long string with '\n' in the middle.
4
votes
3answers
4k views

what's the usage of -exec xargs and -print0

I think these are the common ways of passing the result of one command to the next one, as inputs. Can anyone here explain to me how these three works? or forward me to some websites/URL?
1
vote
3answers
27k views

Need some help with Terminal Emulator (Android app) commands. (Similar to Linux commands)

I'm trying to follow this tutorial to install Mobile Defense as a system application on my Motorola Droid. I want to use Terminal Emulator and the commands are basically the same. The only two ...
6
votes
6answers
10k views

How do I set $ variables in unix?

For example there is a long path that I cd to very often. How do I store the path in a variable so that I can use it everytime? For example: I wan to be able to do this cd $path instead of cd ...
6
votes
2answers
845 views

What exactly interpret #!/bin/bash line?

Many scripts in different languages have a #!/bin/bash header with a path to interpreter, so they can be executed without explicit call to interpreter from command line. But what exactly reads this ...
9
votes
11answers
11k views

how to `tail` the latest file in a directory

In shell, how can I tail the latest file created in a directory?
15
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
883 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 ...
19
votes
8answers
42k 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
102 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
16k 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
481 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
303 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, ...
23
votes
9answers
95k 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
34k views

Delete matching files in all subdirectories

How can I remove all .swp files in all of my subdirectories under Linux?
0
votes
0answers
173 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
257 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
15k 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
952 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? ...
5
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
10k 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
5k 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
251 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 ...
16
votes
2answers
6k 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
168 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
445 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
351 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
612 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?