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

learn more… | top users | synonyms

2
votes
3answers
2k views

Is there a way to insert a timestamp in a file in Ubuntu?

I often find myself needing to type out a timestamp into a text file. Is there a way to quickly insert the current timestamp into a file in Ubuntu?
8
votes
4answers
11k views

How do I log all UNIX shell commands submitted by all users?

Is there an elegant way to log every command submitted in all shells on a machine? This is in the context of an infrequently-used Ubuntu server, of which I am the only human user. (There are several ...
0
votes
1answer
4k views

ksh Auto-Completion PuTTY Configuration

I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell. I do a listing on the root with the directories /home and /homeroot and it returns ...
1
vote
2answers
1k views

copying a file to multiple machines

Is it possible to copy a file on multiple remote machines through scp in one command?
2
votes
1answer
1k views

Send scheduled SMSs via Skype

I would like to send programmed SMSs via Skype. I mean, I write a list with SMSs to different people that says; a) send a 04:30 a SMS to Joe "Wake up please, we meet at 05.30!", and so. The first idea ...
71
votes
7answers
37k views

How can I make tmux use my default shell?

On a new setup, tmux is using bash instead of my default (zsh). How can I force it to use zsh?
2
votes
1answer
1k views

Don't know why this small shell script wont work

I'm trying to make a small script to start up gunicorn for a python website I'm making. I have modified the script found at https://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc ...
0
votes
1answer
2k views

Multiple “My Documents” folders?

I am having the issue, where, I have 2 folders called "My Documents". I recently edited my registry to make "Document" link in the Windows 7 start menu be a FOLDER link and not a LIBRARY link.. Here ...
6
votes
2answers
902 views

Potential issues with adding /usr/local/[s]bin to root's path?

I've noticed that the root account $PATH does not include /usr/local/bin or /usr/local/sbin by default. Are there any potential issues that could arise from adding those directories to the path? If so,...
0
votes
1answer
48 views

How the teminal shell HostName can be as “229:~ lancee$”?

It prints : "Last login: Tue Mar 1 17:19:48 on ttys000 ly-lanceedemacbook:~ lancee$ " when I login terminal on my Macbook with networking. But sometime go like this : "229:~ lancee$" random ...
3
votes
1answer
361 views

Distinguishing local and remote access in shell (TERM-related)

My default TERM is xterm-color. I would like it to be xterm-256color when I am working on my machine locally, but if I ssh to it I want to have it be xterm-color. How do I distinguish these two cases?
3
votes
1answer
2k views

copy (split?) stdout instead of redirecting it

In Bash, I'd like to redirect stdout to a file (>> mylog.txt) but also see the stdout output on the screen.. How can I do it with bash?
2
votes
1answer
314 views

Any way to sync files from two parent directories, when their inside structure is different?

Lets say we have two directories: Directory A: aaa.mov bbb.mov ccc.mov ddd.mov eee.mov Directory B: subdir1/aaa.mov subdir1/bbb.mov subdir2/subsubdir/ccc.mov How could I transfer from A to B/...
4
votes
1answer
1k views

How to use regex quantifiers to rename multiple files with zmv?

I have the following files in a single directory: 1-1 - different text for each file here.txt 1-2 - different text for each file here.txt . . 1-9 - different text for each file here.txt 1-10 - ...
6
votes
5answers
2k views

Delete all empty folders, even with .svn folders in it

I'm trying to delete all empty folders within a directory. However, find . -type f -empty does not find anything because every folder contains a hidden .svn folder. How can I work around this?
2
votes
2answers
1k views

How to get down-arrow history browsing in bash in Mac OS X Terminal?

On almost all modern command-line environments I've used, you can hit up arrow to go back a few commands in your history and re-run an earlier command. But on some command-line environments I've used,...
0
votes
2answers
1k views

How do IRC clients, shells and bouncers work?

let's say I take free shell and start irssi with the nick: nick_test and of course nick stays online 24/7, right? But if I connect with my IRC client, like mIRC or xchat and set my nick to nick_test ...
0
votes
2answers
1k views

How do I prevent infinite recursion in X11 start-up process?

I wasn't able to run X11 or Terminal after rebooting my Mac. After digging around, I got them to work when I commented-out this line in my .cshrc: xset b off It appears that xset will attempt to ...
0
votes
4answers
568 views

Changing $PATH variable

I used this to add to PATH: APXS2=/usr/local/apache/bin/apxs PATH=$PATH:/usr/local/apache/bin passenger-install-apache2-module and my PATH now looks like this: /usr/local/jdk/bin:/usr/kerberos/...
31
votes
7answers
24k views

zsh with Cygwin

How can I configure zsh to be the default shell under Cygwin?
1
vote
2answers
192 views

Forcing an Absolute path where a relative path is expected

I have a program that takes a relative path as input appends it to a some path string to get the actual path. Now all I can input is the relative path. So if I want to go one level above my input ...
30
votes
7answers
74k views

List open SSH tunnels

I use a lot of SSH tunnels to various servers on my linux machine (for tunnelling to databases, web servers etc) and it would be really handy to view a list of current open tunnels via a shell script. ...
1
vote
1answer
88 views

Is it possible to set a Custom quick look preview image in OS X?

Is there any way to set a custom quick look image in OS X? I'd like a command line tool or applescript to change or embed a custom preview for a zip file using a jpeg.
8
votes
3answers
487 views

Tabbed terminal that connects to a GNU Screen session?

I use the session feature of screen extensively. For example, I'll start a screen session for "project1" as "screen -S project1", and then when I need to reconnect I use "screen -d -r project1". ...
3
votes
2answers
4k views

How to find out the amount of lines of documents in a folder using shell scripts?

I have a folder full of my code, what shell script can I use to find out the total amount of lines of code?
0
votes
3answers
1k views

Optimize shell and awk script

I am using a combination of a shell script, awk script and a find command to perform multiple text replacements in hundreds of files. The files sizes vary between a few hundred bytes and 20 kbytes. ...
0
votes
1answer
1k views

ImageMagick's “import” command line program failing to take a screenshot from CRON script

Hello I wrote a simple command line script which is suppose to take my screenshot every 5 minutes. (using ImageMagick's "import" program) here is the script (shottr.sh): #!/bin/sh PTH="/home/...
0
votes
1answer
226 views

how to compile the latest rdiff-backup in debian?

The problem here is that in my ubuntu desktop pc, the repositories contain the latest rdiff (1.2.8), but in my debian server, the repositories contain v1.2.5. I get an error that the versions are ...
0
votes
1answer
725 views

resuming mget in shell

i have a large set of files in host B and i'm trying to mget these files from the shell of host A (host A allows shell access while host B doesnt but gives ftp access). In the middle of the job, the ...
2
votes
3answers
256 views

Best way to shorten comand options in *nix

Which would be the best way in *nix (alias, script, etc) to shorten available options for a command that doesn't provide a short form? The idea would be to wrap the command in some way be able to ...
11
votes
5answers
9k views

gzip all files without deleting them

I need to gzip all files in a dir separately including all files in sub-directories without deleting the originals afterwards. So let's say I have index.html, I want to have at the end index.html.gzip ...
1
vote
1answer
312 views

download and process a file by ftp at set intervals, with error handling, rescheduling and status messages

I want to download a data file from a remote ftp server to my machine at regular intervals. Once the file is downloaded I want to call another script which will process the file. My development ...
3
votes
1answer
563 views

Can I reattach to terminals that show up in `ps`?

I am a unix noob using zsh on mac osx and playing with tmux. I opened up a terminal window in iTerm2 then ran tmux. Once that was opened I created a few new windows with ctrl+b c. I then closed ...
1
vote
1answer
2k views

How to Rename the “Desktop” Folder?

I have a Swedish version of Microsoft Windows 7 (64-bit). In my user folder, that is, in C:\Users\Andreas Rejbrand\, there are folders Desktop, Documents, Pictures, Music, Downloads, etc. However, in ...
1
vote
3answers
3k views

Windows 7 Favorite folder doesn't work

So recently I did a very stupid thing and accidentally deleted my APPDATA, and now the favorite folder doesn't work anymore. The favorite folder I am refering to is the one in windows explorer in ...
1
vote
4answers
624 views
91
votes
7answers
96k views

What to do when Ctrl + C can't kill a process?

Ctrl + C doesn't always work to kill the current process (for instance, if that process is busy in certain network operations). In that case, you just see "^C" by your cursor and can't do much else. ...
2
votes
2answers
1k views

Determine/resolve filepath/alias of a certain command in the Windows command prompt

How can I find out to which filepath (or alias) a certain command input will point to, in the Windows command prompt? Specifically Windows XP, info on other versions also appreciated! On Unix systems ...
16
votes
2answers
17k views

Unix: How to merge two directories

Say I have two folders with various content, foo and bar. How can I merge bar into foo so that: Files in foo that are not in bar are untouched. Files in bar that are not in foo are now in foo. Files ...
2
votes
2answers
8k views

Terminal emulator with split panes for Mac OSX

I'm looking for a terminal emulator on Mac OSX with a specific feature: to be able to split the console window into multiple panes. It's a great feature of Terminator for gnome, I think this image ...
0
votes
1answer
976 views

Exclude/Include files from unix find command based on program

I'm wondering if there is any way to include or exclude files from the results of find(1) based on the output or exit code of another program. Specifically I'd like to be able to run find(1) such ...
1
vote
2answers
868 views

Shell Script File - Pass Multiple Parameters to Interpreter

I have a Python script that I run which needs to execute under a special environment, so I would run the program like so from my working directory (~/project/src): python manage.py shell This opens ...
1
vote
4answers
804 views

What is the fastest way to reload history commands begin with certain characters in linux?

In Dos we can input the first several characters to filter command history and find proper one rapidly. But how to do the same thing in Linux ? for example when I am testing a local server: cd sudo ...
1
vote
2answers
131 views

terminate the background task launched by xterminal

I used Xterm -e command to run six programs in the background in six X terminals in my shell script. When I used PS command, I can see 6 Xterm process running in the background but I can't see the ...
5
votes
1answer
4k views

Problem with quotes around file names in Windows command shell

I have Windows XP Home SP3 running. Trying to run this command: cmd /c "C:\Program Files\TortoiseSVN\bin\subwcrev.exe" .. ..\Modules\getbuildinfo.c Win32-temp-Debug\getbuildinfo2.c It works fine (...
4
votes
2answers
4k views

find files within a specific directory structure but a variable parent directory structure

I want to use the find command in linux to find a specific file nested within a specific directory structure, say dir1/dir2/reqdfile. But this directory structure can itself be nested within any ...
1
vote
2answers
709 views

GNU/screen not setting $STY

I'm trying to script the spawning of GNU/screen windows by using commands of the form screen <CMD>. For some reason when I start GNU/screen (by hand), the shell that it starts in window 0 (/bin/...
5
votes
2answers
3k views

Delete all files older than X days

So I have a cron setup to make backups of a folder into a tarball every hour. I would like to add into the shell script that I'm using the ability to have files deleted automagically after about three ...
0
votes
1answer
643 views

Locking Environment Variables

Is it possible to restrict the user from changing some set of environment variables? I have have a script that sets PATH to point at a specific build of some software, and puts the user in a new ...
3
votes
2answers
365 views

Byzantine behaviour in shell script

I wrote the following script to interactively and recursively remove orphan backup files, i.e. remove each file.txt~ that does not have a corresponding file.txt. #!/bin/sh -x set -o errexit unalias -...