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

learn more… | top users | synonyms

8
votes
2answers
1k views

How can I prevent tmux exiting with Ctrl-d?

I use tmux on my server and recently I found to my cost that ctrl-d will exit tmux and lose all the session information, my intention was to simply end the ssh session but failed to notice I was still ...
3
votes
4answers
475 views

When I ssh into a ubuntu machine, what kind of shell am I using

I keep reading about interactive, non-interactive, login, and non-login shells. (This is in the context of which of the .bash* files is read). I don't understand what each type of shell is, so let's ...
1
vote
1answer
169 views

Limit CPU usage KSH script

I have a KSH crawler script that crawls filesystems on my network, and i would like to limit it to 25% cpu usage, so it does not impact running systems. I am currently using nice but when i run SED, ...
1
vote
1answer
340 views

How to Download Multiple XML files from different URLs

@slhck provided a useful answer to this similar question. Downloading multiple files with wget and handling parameters This code was provided to read urls from a text file filelist, then run a loop ...
1
vote
2answers
100 views

FIND operands and order of arguments

I have a find command that I am unsure if I am placing my arguments correctly. find / -xdev -size -size -262144000c -o -type d \( -name .snapshot -o -name man -o -name Man -o -fstype mvfs \) -prune ...
2
votes
4answers
1k views

Accessing an exit code outside of a su -m $USER -c “<cmd>”

The below command prints "0" or "1" correctly depending on failure or not because i put $? inside the "su" command. sudo su -m $USER -c "./shutdown.sh &> /dev/null; echo \$?" However, if i ...
0
votes
1answer
240 views

windows “open command window here” gives wrong environment

I often use the right-click "open command window here" feature of Windows-7, but just found a problem where the environment it gives is different than what I get on running cmd from the start line, or ...
2
votes
2answers
933 views

How to create limited user accounts in Linux

I want to create a user account for each of the key programs installed on my debian server. For example, for the following programs: Tomcat Nginx Supervisor PostgreSQL This seems to be recommended ...
2
votes
2answers
148 views

gksu is a front end to su?

gksu manual page says that it is a front-end to su, however su doesn't need a command to be executed, while gksu does. Also, gksu doesn't seem to change the user ID of my shell, while su does. Is it ...
7
votes
1answer
304 views

Setting http_proxy for Chromium in shell

In order to set proxy in Chromium browser, one needs to go to Settings → Under the Hood → Change Proxy Settings → Network Proxy. It's too complicated. How do I set http_proxy in shell? I've ...
3
votes
2answers
340 views

How can I run several parallel shell jobs and monitor all of them at once?

I have a large number of large files (hundreds of files, hundreds of MB each) which I need to pipe through a number of programs to filter and convert them. I'm taking advantage of multiple CPU cores ...
3
votes
1answer
389 views

Is there any way to open an “incognito” Terminal/shell?

Under normal circumstances, a command typed in a Terminal/shell can be retrieved later via history command or other means. Is there any way to have an "incognito" Terminal/shell, i.e. one whose ...
3
votes
3answers
272 views

Can I remove the ctrl-z key binding in my shell?

The background for this question: I currently have to do a lot of my work in terminal over ssh, and I use screen quite a bit. Because I found the ctrl-a key binding for screen commands so annoying ...
1
vote
3answers
261 views

Colored PS1 string

Clarification: I want __foo to be executed each time the PS1 string is presented in the terminal, not when the PS1 string is constructed (hence its being in quotes). __foo contains logic that examines ...
3
votes
1answer
304 views

What's the difference between unix sort and sort -d

After some time spent experimenting with unix sort I have noticed the following behaviour files.list: betty ./adam ./cyril The result of sort files.list is the same as the result of sort -d ...
0
votes
1answer
240 views

erlang-shell mode in Emacs doesn't show the error_logger error

I like Emacs and Erlang too; I have set-up the erlang-mode and distel properly. In my project,when dealing with the log,it doesn't show the =ERROR REPORT==== 15-Sep-2012::14:09:30 === in the ...
1
vote
1answer
208 views

Shell wrong encoding

Somehow I managed to screw up my shell-encoding. An example: root§server:ç£ cat --help Usage: cat ¡OPTION¿... ¡FILE¿... Concatenate FILE(s), or standard input, to standard output. -A, --show-all ...
0
votes
1answer
226 views

Wrap file output at given column

I would need to print the contents of a file (e.g., cat $file), but wrap output at a given column width (let's say 80 cols), independently of terminal width. Is there something in the "standard" Unix ...
0
votes
3answers
7k views

What does ~ mean in a Linux shell?

I'm new to Linux and have been seeing this often. Could someone explain the concept here? ~/.somefilename What does the ~ (tilde) signify?
5
votes
1answer
588 views

Right and fast way to test git directory and git branch?

While trying to set up my new fish shell prompt, I ended up testing ways to get the branch name and also testing if I was on a git repository. I have found (1) git rev-parse --abbrev-ref HEAD, (2) git ...
0
votes
3answers
105 views

Emacs and Shell in the same window?

Just wondering if there is any way to put emacs and shell in the same window. Like split the shell in to two parts, one for shell it self, the other one for emacs. Or is there any way to switch the ...
3
votes
2answers
218 views

Force sudo to ask for password once from outside sudoers

I'm trying to hack together my own Android app that opens an SSH connection to my computer, and sends commands. I am aiming to keep the interactivity of this process to a minimum, to make it have the ...
0
votes
1answer
86 views

vim leaves the ouput after quitting

everytime I use vim, it leaves the output of the last file in the terminal. This didn't use to happen before. It used to clean up all the buffer. for example, the current behavior is /Users/snihalani ...
1
vote
0answers
198 views

zsh post command function/hook [closed]

Is there an equivalent of zsh's precmd for performing a function after a command has completed? I'm looking for a way to send myself a notification for any process that takes over 60 seconds. Zsh has ...
0
votes
2answers
703 views

Create new empty directory tree from existing tree with files

I have a large directory tree with lots of files. I would like to re-create the directory structure in a new location, but only the directories, not the files. I've checked cp's man page, but don't ...
3
votes
1answer
102 views

Linux shell scripting: unexpected variable behavior

I have a variable $myvar that contains two lines, and I want to put first of them into a new variable. When I try: $ myvar1 = $(echo $myvar | head -n 1) It doesn't work because echo doesn't ...
0
votes
1answer
25 views

starting application with custom initial folder

I am working on linux. Do you know which command to start an application setting an "initial folder" for it. If I start my app from a directory that is not the one containing the app itself, some ...
1
vote
3answers
1k views

windows CLI looking like ubuntu terminal [closed]

How can I make my windows 7 command line interface to look like the terminal in Ubuntu ?
1
vote
2answers
250 views

Edit the command line path for an executable on OSX [duplicate]

Possible Duplicate: What are PATH and other environment variables, and how can I set or use them? I have the default package of Ruby installed that shipped with the OS, which is an older ...
1
vote
1answer
41 views

What is [root@server ~#] as opposed to [root@name ~]#

What is [root@server ~#] as opposed to [root@name ~]#? Notice the # is inside the bracket on the first one and outside on the second one. What is the first one and what command in a terminal gets you ...
1
vote
2answers
176 views

How do I list only source code files when I type ls on OSX?

when I type ls, I don't want to see .o files because everytime I ls, It see X.cpp X.h X.o, how do I not list .o files?
1
vote
3answers
1k views

How to find files on Linux where only root has read permission

I want to find files in some folder like /home/mike/www/test where only root has read permissions and not any other user. EDIT: I have the sudo and permission but I want to list all files where only ...
0
votes
1answer
582 views

How can I block a certain set of commands from being executed in linux?

I want to block a set of commands as soon as they are entered by the user on the terminal. How can I do that?
0
votes
0answers
38 views

Shell Hotkey to Add File Name to Command

I have forgotten the hotkey to add a filename when using commands such as "cd". For example: cd (hotkey). and each time you press the hotkey, you get the name of one of the files in the current dir ...
4
votes
2answers
524 views

pass filename and current line to shell script

I would like to pass the file name and the current line number where my cursor is at, separated by colon, to an external shell script. For example, if am editing the file "foo.c" and I am currently on ...
2
votes
3answers
158 views

In Power SHell set alias cp to cp -v

I have cp for power shell. But I want to use cp in verbose mode without writing -v. So cp should be aliased to "cp -v" command. How to alias cp to "cp -v" in power shell?
2
votes
3answers
1k views

how to use updatedb command as an ordinary user on linux?

locate command is very useful tool on linux, but it seems only root can run updatedb command, so it will be very unconvinent to use locate command on linux, so how to make ordinary user to have the ...
4
votes
2answers
323 views

How to put unread mail messages in shell prompt

I am using OS X and I want to know if there are any unread messages in my Mail.app? I want to put that number in my shell prompt. How do I go about it?
1
vote
1answer
209 views

How to set and print environment variable in Power Shell?

I work on Windows 7 and I wont to know how to set and print environment variable in Power Shell (for example $PATH)?
0
votes
1answer
1k views

linux shell installing packages automaticc

I want to install packages automatically by running a script I can write yum install php but I want it to install another package once installation of the php package is completed Is there any ...
0
votes
0answers
66 views

Can someone put some restriction to copy few files from folder by root in linux

I have the backup script where i was making the tar backup of directory everyday. ON friday i note that my filesize was 30MB but beofrethat it was 200MB. I checked the main folder and it was around ...
2
votes
1answer
170 views

IP GeoLocator. Need included script to take source of IPs from txt document

Below is a shell script I would really like to be able to feed a txt document of IP addresses to determine countries accessing my website. Inside the text document, lets call it "IPlist.txt" might ...
1
vote
1answer
136 views

Linux commandline - auto-optimize pictures

I have a web-app that has very many pictures. Is there a linux commandline utility which I can use to "auto-optimize" all JPEG pictures in a Photoshop-like way. Maybe with Gimp in the backend or so? ...
0
votes
0answers
135 views

Boot directly into application when power is cut

I have an application that I replaced the windows shell with so that windows would boot directly into the app instead of loading the desktop. After doing some testing I found that windows doesn't boot ...
1
vote
1answer
523 views

Windows command line escape characters

Long story short: We receive a command from a script and want to execute it using windows shell. Currently we use a method similar to: echo start & command & echo finish That works fine ...
2
votes
1answer
490 views

How to permanently mount ntfs drive in WUBI installation mode?

I have a Windows 7 installed as my primary operating system on my C:\ drive. I have another ntfs partition, D:. Ubuntu is installed using WUBI on C:\Ubuntu, which makes C:\ accessible through ...
4
votes
4answers
856 views

How can I edit a file if there is no vi, vim, joe, etc?

Is there a way to edit a file if there are no vi, vim, joe, mcedit? In another words is there a way to edit a file using just the shell commands?
0
votes
3answers
2k views

Load login shell inside user cronjob

I'm trying to run a rake task using a scheduled cronjob. My crontab looks something like this: 0 1 * * 1-7 /bin/bash -l -c "cd ~/jobs/rake && rake reports:create >> ...
1
vote
3answers
152 views

Programming languages, Linux and windows shell access [closed]

What is a difference between Linux and Windows shell access tool? In some programming languages (web languages from my experience) when you need to execute some command - you need to specify path to ...
2
votes
1answer
166 views

Bash local variables

How can I declare variables which are local to functions? Regularly declared vars get exported into global scope. Example: $ cat t.sh function locals_test() { x="bar" } $ echo $x $ locals_test ...