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

learn more… | top users | synonyms

3
votes
1answer
4k views

OS X (Unix) shell command: possible to get last opened date of file?

when you use the following command find /Users/someUser/someFolder/* -type f -mtime +90 you'll get all the files that have a modification date that is bigger than 90 days. If you open however the ...
5
votes
19answers
1k views

Useful Linux commands for programmers?

I am taking a test soon and I would like to know useful commands on Linux for a programmer. Some examples are string, strace, top, free, df, mount, cat, head, tail, whoami, touch. What are others? I ...
3
votes
2answers
104 views

Is there a specific name for the .. or . on *nix systems?

Just what it says. Do they have a name besides "those dot thingies"?
1
vote
1answer
513 views

What chsh did when I type `chsh -s SHELL` and how to go back to previous SHELL?

I have mistakenly setting my user login shell to some unknown directory:([1]. Now, I can't login to this user. Every time I try to ssh, it always failed as if I enter the wrong password. I try to ...
3
votes
2answers
7k views

How can I add a timestamp to the end of a cron job's output file name?

I want to track each crontab output to separated file. Normally, I use this as crontab entry: 1 * * * * root php /mix/dostuff.php > /tmp/dostuff.txt Now, I want to make it to write ...
0
votes
1answer
2k views

What's the best way to convert this complex “takeown” command into a shutdown script?

I found this command here. The command is structured as a registry modification that will add a "Take Ownership" entry in the standard Windows Explorer file/directory context menu. I can see where ...
74
votes
11answers
46k views

How to reliably keep an SSH tunnel open?

I use an SSH tunnel from work to go around various idotic firewalls (it's ok with my boss :)). The problem is, after a while the ssh connection usually hangs, and the tunnel is broken. If I could at ...
8
votes
9answers
2k views

Linux & Shell - Is Shell a must?

A total newbie question. Why do we need a shell in Linux? As an example when I type - find . -name xy* - I was told that the shell takes this input and calls the find command (making sure the wild ...
0
votes
2answers
2k views

how do I copy files from a remote host to my computer?

I am trying to use the following command: $ scp remoteusername@host:$HOME/fileiwanttocopy /my/local/comp I woould like for home to be evaluated on the remote host instead of my computer (which it ...
3
votes
3answers
1k views

Custom colors for shell

How do you customise the default colours in the shell? Say I want to make the standard cyan, magenta and yellow slightly lighter. There is a method shown here for OS X Terminal using drag and drop ...
29
votes
6answers
75k views

looping through `ls` results in bash shell script

Does any one have a template shell script for doing something with ls for a list of directory names and looping through each one and doing something? I'm planning to do ls -1d */ to get the list of ...
0
votes
2answers
486 views

Why does my shell not accept shortcuts in my remote AIX session?

I'm logging into an AIX 5.3 Machine with putty via SSH. When I press TAB it will actually insert a TAB instead of trying to complete a statement, up and down keys don't cycle through history but ...
1
vote
2answers
59 views

Remote execution stops when local computer boots

When I run a process on a remote Linux machine, the process stops if the connection is terminated for some cause. This behavior is reasonable, because otherwise irrelevant processes would keep running ...
10
votes
1answer
2k views

How do I make OS X set the terminal title back to the original title when coming back from ssh?

Starting on OS X, I ssh into foo (a Linux box). My terminal title changes to foo. I then ssh into bar (another Linux box). My terminal title changes to bar. I log out of bar. My terminal title ...
19
votes
3answers
8k views

Screen a running process

Sometimes I forget to run a program under a screen session and can't stop it in the middle, and I know it's going to take long. Is there a way to screen an already running process without restarting ...
5
votes
6answers
6k views

Why does my LD_LIBRARY_PATH get unset launching terminal?

I have a shell script to set up some environment variables and launch whatever program I send in as an argument: export PATH=$HOME/local/bin:$PATH export ...
0
votes
1answer
193 views

Why terminal shows “/home/igoru /etc/bash_completion” every time I open it?

I've added some lines to ~/.bash_aliases yesterday... And today my gnome-terminal started showing me this expression in the beginning, just before the prompt. /home/igoru /etc/bash_completion ...
1
vote
2answers
82 views

Error message shows up in terminal

Every time I fire up a terminal window, I get the following error message: bash: exxport: command not found I know I misspelled aa symlink somewhere, but I can't find it. Is there any way to ...
25
votes
7answers
61k views

Copy directory contents using 'cp' command

How do you copy all the contents of one directory into another? For example: $ cd /home/newuser $ cp -a /backup/olduser/* . The problem with the above is that the globing pattern '*' matches the ...
2
votes
2answers
254 views

History of commands?

Is there any way to find which commands have been executed between 2 specific dates (like 2 to 3 months period)? I can use the history command, but I have powered the system on/off. Is this ...
8
votes
4answers
1k views

Bash Shell Tutorials [closed]

What are some good bash tutorials? I would like to learn more about the bash shells commands and how to use them.
10
votes
8answers
3k views

Mass renaming, *nix version

I was looking for a way to rename a huge number of similarly-named files, much like this one (a Windows-related question) except that I'm using *nix (Ubuntu and FreeBSD, separately). Just to sum up, ...
7
votes
3answers
9k views

How to join files on the command line without creating temp files?

I have two files in a Linux / Bash environment: # Example data $ cat abc 2 a 1 b 3 c $ cat bcd 5 c 2 b 1 d I'm trying to join the two files on the first column. ...
1
vote
2answers
127 views

Linux redirection question

What does the following do on Linux? cat <> FIFO | Where FIFO is a FIFO created in the current directory.
3
votes
4answers
2k views

need to know the use of rm -f in unix and how to implement in dos

rm -f /obi/u01/informatica/v711/pmserver/SrcFiles/coe/aone/AccessOne_Daily_Input.xml What is its use in unix and its possible implementation in dos?
12
votes
7answers
20k views

Make ls sort by file type (then name)

By default the ls command sorts just by filename, but I want directories to appear before other file types. I might even want files to be sorted by extension, like the way Windows explorer sorts by ...
29
votes
4answers
2k views

Difference between “a=b” and “export a=b” in bash

What's the difference between: a=b and export a=b In bash? I understand that they both define environment variables, but I don't fully understand the difference.
4
votes
2answers
220 views

shell dotfiles and *rcs: what's a sane setup?

A bash user will eventually end up with .bashrc, .bash_profile, .profile, and maybe some more. Now, each file gets loaded unders particular situations, and it all leads to confusion and frustration. ...
12
votes
5answers
3k views

How to show the current Vi mode when using Vi keybindings in the shell?

I use the vi keybindings in my tcsh shell. Now, I don't know which vi mode I'm in (insert mode or command mode), which leads to a lot of frustration. Does anyone know of a way to show the current ...
6
votes
4answers
902 views

How do I combine stdout and stderr for different shells?

I know the answer for some shells, e.g. with cmd.exe you can: some.exe > out.txt 2>&1 How do you achieve the same for other shells (bash, ksh, tcsh, powershell, etc)?
3
votes
1answer
461 views

difference between lam and paste

I don't get the difference between the program lam lam -- laminate files The lam utility copies the named files side by side onto the standard output. The n-th input lines from the ...
5
votes
2answers
208 views

Can I have a bunch of tabs set up when I launch Terminal?

Every morning I launch the OS X app Terminal and tediously set up a bunch of tabs... A ssh session to a certain server ($ ssh ...) A script/console session for the Rails app I'm working on ($ cd ...
10
votes
3answers
2k views

How can I launch a file properties dialog from the command line?

It's simple programmatically with ShellExecute to specify the properties verb when instructing Windows to open a file, but can this be done from the command line or run box? Ideally I'd like to do ...
9
votes
3answers
655 views

Figure out what non-symlink path would be?

On Linux, if I've cd'd around and am now in a directory, is there a way to figure out what the real path to that directory is if I had not used a symbolic link to get there? Consider: $ pwd ...
2
votes
1answer
202 views

ksh equivalent of perl $! error reason

Is there an equivalent of $! in ksh, which provides the error string ? $? stores the exit code only.
1
vote
2answers
716 views

How to find and then compare similar files in Dropbox folder?

I am using Dropbox, and I wind up with a number of files like: prefs (home's conflicted copy 2009-07-20).js What I would like to do is find all the "conflicted copy..." files and then compare each ...
3
votes
2answers
540 views

Mac OS X: simple script wanted

I'm looking for a simple script that will do the following. Can anyone take a shot at it (+ if cryptic, please explain what it does), or give me some pointers so I can run this myself? I want to ...
12
votes
3answers
11k views

Mac OSX: conventional places where binary files should live

I'm only vaguely familiar with Unix and the filesystem convention for Macs, so sorry if this is a dumb/easy question. I've downloaded an application that is a command-line application, and want to ...
4
votes
8answers
1k views

Killing the Windows Shell

On Linux machines you have the handy Ctrl+Alt+Backspace to restart the X server, if your GUI hangs. Is there something comparable on Windows? I.e., a combination of key strokes to kill/restart the ...
26
votes
6answers
7k views

What zsh features do you use? [closed]

I do a lot of work in the terminal so I have learned a lot about my shell of choice, zsh. What features of zsh do you use to make yourself that much more productive at work? One of my favorites is ...
12
votes
6answers
8k views

Full command text with unix ps

When we enter: ps -f ... the CMD column text doesn't show the full command. Any way to prevent this truncating? Seems like it's showing the first 80 characters. We are running a fairly ...
21
votes
4answers
8k views

How do I change a users default shell in OSX?

What is the correct OSX way of changing a users default shell? When I googled for it I found several references to an application called NetInfo Manager but I couldn't find it on my system. There were ...
17
votes
5answers
47k views

How can I edit the $PATH on linux?

I am using ubuntu 9.04 I need to add some folder to my $PATH. I know how to read the path: echo $PATH I want to be able to edit it and add 2 other paths. Thanks
447
votes
7answers
286k views

How can I sort the output of 'ls' by last modified date?

How can I sort the output of ls by last modified date?
115
votes
12answers
95k views

How do I detach a process from Terminal, entirely?

I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy. However, I'm struggling with how to completely detach a ...
10
votes
8answers
15k views

Windows Vista: How to execute a .exe program in the cmd “As Administrator”

Yes, that's it. I need to run a program .exe in the dos cmd line and it needs to run like when you right button and select "run as an administrator"
9
votes
12answers
1k views

Best way to organise one's sh/bash/python/etc. scripts

What is the best way to organise the sh/bash/python scripts you collect and write on your system?
16
votes
9answers
43k views

Opening Explorer shell with admin privileges on XP (with IE7 installed)

I used to demote my user account so that it had no admin priveleges and used a 'sudo-like' trick where you create a shortcut to IE6 and enabled the 'Run with different credentials' option to open a ...