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

learn more… | top users | synonyms

0
votes
2answers
780 views

Unix command for finding and deleting folders with folder names in date format

I have folder names in the below date format 20130801 20130802 20130803 20130804 20130805 20130806 20130807 20130808 . . . 20130819 Similarly ,I have folders created from past two years for each ...
0
votes
1answer
839 views

Add a shell script to xcode project and double click to run it

I added a shell script file to Xcode project and gave extension as .command My intention is to double click it to run my script. But when i double click it opens in text editor. How to make it ...
2
votes
1answer
325 views

Error “Insecure world writable dir /Volumes/BOOTCAMP in path, mode 040777”

I tried the answer sudo chmod go-w in my /Volumes/BOOTCAMP but I'm still getting the warning It says Insecure world writable dir /Volumes/BOOTCAMP in PATH, mode 040777 And when I echo $PATH ...
112
votes
7answers
192k views

If I know the PID number of a process, how can I get its name?

If I have the PID number for a process (on a UNIX machine), how can I find out the name of its associated process? What do I have to do?
39
votes
10answers
3k views

What does an operating system look like without a shell?

A shell like the bash or command.com (up to Windows ME) or CMD.EXE (in later versions) provides an interface that (among other things) accepts commands from the user. What does an operating system ...
3
votes
2answers
6k views

rm -rf return codes

Any one can let me know the possible return codes for the command rm -rf other than zero i.e, possible return codes for failure cases. I want to know more detailed reason for the failure of the ...
0
votes
3answers
1k views

How to schedule/unschedule cron job from shell

I have a ubuntu server where I put my application core. It's a jar that needs to be always listening for requests. I made a script to run it with the correct parameters. The scenario is similar to ...
2
votes
1answer
258 views

How do you call ActivePython from cygwin shell?

I installed ActivePython which is a Python version 3.x installation for Windows. I renamed the interpreter to be activepython.exe so as to allow calling it from cygwin without modifying /etc/profile ...
1
vote
1answer
3k views

On Windows 7 how do you check to see if a file is a hardlink? [duplicate]

I just created a hardlink in Windows 7 using mklink. When I use dir the output doesn't indicate that the new hardlink is a hardlink. Instead it looks exactly like the file it is pointing to. Example ...
2
votes
1answer
109 views

Invoke a script for every command typed at shell prompt?

On bash, is there any simple way to run a command every time another command is entered in your shell? I know about 'trap ... DEBUG', but unfortunately it does not run the specified code for every ...
3
votes
1answer
273 views

Quote or bracket completion in bash, without pressing TAB

Is there any way to have bash autocomplete matching symbols like '"[{( with their right handed counterparts? I would like to do this without having to press tab. For example typing the string echo " ...
1
vote
3answers
973 views

Why do random characters appear in terminals in Windows?

I've been programming on Windows for a few years, and there has been an issue that is becoming increasingly frustrating as I have really started to use various terminals in Windows for my development ...
2
votes
1answer
962 views

How can I pipe the output of *all* entered shell commands into another? (e.g. pipe everything into 'lolcat')

Good Afternoon, (OS X user) I am specifically trying to pipe the output of every shell command I type into the ruby gem 'lolcat' (which makes the output to the terminal rainbow colored). Is there a ...
10
votes
2answers
3k views

How to cut a file to a given size under Linux?

I want to shrink a file's size by brute-force, that is, I don't care about the rest, I just want to cut the file, say by half, and discard the rest. The first thing that comes to mind is Perl's ...
-1
votes
1answer
387 views

Download reports from Bugzilla

We habe a password protected Bugzilla instance and I would like to download a report in CSV form. Using wget $URL or curl $URL I do not get any error, no authentication request. Bugzilla just ...
0
votes
1answer
751 views

Enable FTP disable SSH

I would like to know how enabling FTP access while disabling SSH access for all users except root and admin. I tried to change the shell : /usr/sbin/nologin is no good because disable both and /bin/...
1
vote
2answers
498 views

howto change screen hardstatus dynamically with format, from shell?

howto change screen hardstatus dynamically with format, from shell ? I successfully configured screen using 256 colors and tabs and so on, here is my .screenrc : http://pastebin.com/g8XbMWBH I use ...
1
vote
3answers
590 views

How to make the visible command line longer?

I have a machine that running customized linux, and I login into the system by PuTTY. It turned out I'm using bash. And the PS1 is sh-4.1# echo $PS1 \s-\v\$ when I type following: sh-4.1# ls a ...
1
vote
0answers
213 views

Shell command to find width of a text rendered with some font

I need to find the width, in pixels, of a string displayed with some font. I know that I can do: dzen2-textwidth \ -adobe-times-medium-r-normal--8-80-75-75-p-44-iso8859-1 \ "A Tale of Two ...
0
votes
1answer
48 views

History of the name “$PS1”?

Why is the variable containing the shell prompt called PS1 ? Where does it come from ? Does there exist PS2, PS3, etc ... ?
1
vote
2answers
2k views

How to kick other root users logged in from different shells?

I logged into a machine, and entered: insite1@POC-Messaging1:/opt/insiteone/log> last -a | grep "logged" insite1 pts/6 Tue Jul 30 03:59 still logged in 160.110.5.210 root pts/5 ...
2
votes
1answer
158 views

What this command :(){ :|: & };: does? [duplicate]

What does this shell command do in Linux :(){ :|: & };: How can it be used in Denial of Service attacks?
0
votes
1answer
157 views

Environmental variables in login shells and interactive shells

I'm sort of confused of login shells and interactive shells. If I run ssh my_remote_server 'echo $HOME' I can get /home/shawk But when I run ssh my_remote_server 'echo $ANOTHER_VAR' I got a ...
0
votes
2answers
165 views

some environment variables not load under certain circumstances

It is most weird. I have set the environment variable TEST in .bashrc, .bash_profile, .profile, /etc/profile and /etc/profile.d/ - everywhere a sane computer might look for it: TEST=successfull ...
0
votes
1answer
72 views

Creating a handy separator in tcsh

In a LifeHacker article they the show how to add a handy little separator between commands (for bash and mac terminal). I am trying to get this to work using tcsh on a RHEL though have not been able ...
-4
votes
2answers
8k views

shell script to send an alert mail if disk usage exceeds 90% and another alert at 95%

I am new to shell scripting and want to implement a script on my server which will automatically send email alerts if the disk usage goes over 90% and second email alert when it goes over 95%. my ...
9
votes
2answers
3k views

Transfer current command to a detachable session (tmux/screen)

I'm currently running a backup and it now needs to be transferred to detachable one like on tmux/screen. Is there a way to do this when the command is currently running? I can send the command the ...
1
vote
3answers
275 views

Abbreviation of if statement options in shell

There is some if statement options in shell script. For example -d for directory -f for file. My question is what does stand for -n and -z options? I know how it works. I want to know etymology to ...
0
votes
3answers
155 views

Temporarily transferring shell settings to remote ssh session?

I am curious, frequently I would like to transfer all of my shell settings (dotfiles) over to a remote session just during my session and then have them reversed when I logout. Even better would be ...
6
votes
2answers
2k views

Prefix to each output of a command on runtime

I am trying to make a modular script. I have several scripts/commands which are called from a single script. I want to prefix the output of each separate command. Examle: My files are allcommands.sh ...
1
vote
1answer
432 views

Not able to call command from within the script

i have installed oversip & when i try to execute the command "oversip" from shell, [root@vhost1111 ~]# oversip NOTICE: <executable> OverSIP 1.3.8 starting... it gets executed. But when i ...
1
vote
2answers
60 views

Remote shell account security

With a shell account like one of these http://shells.red-pill.eu, I would like to schedule chron jobs to backup from Google Drive to SugarSync. How secure are those servers? Can some obscure admin ...
1
vote
1answer
4k views

ntpdate command not found [only when using with cron]

I have a linux machine with ntpdate installed and it is working when i run it from my ssh terminal or from a shell script manually. However , when i add the shell script to crontab i get the error ...
7
votes
3answers
7k views

How can I get the uncompressed size of gzip file without actually decompressing it?

Please find my OS details: $ uname -a AIX xxyy 1 6 000145364C00 I've tried the following command to get size of a file in gzip archive: $ gzip -l mycontent.DAT.Gz compressed uncompr. ratio ...
4
votes
5answers
1k views

Cleaning current directory rm -r * on unix

This is a correct way to clean current directory right? rm -r * .
42
votes
2answers
7k views

what is the difference between “command && command” and “command ; command”

I see these two usage on Ubuntu "command && command" and "command ; command", e.g. apt-get update && apt-get upgrade What would differ if I use apt-get update; apt-get upgrade? I ...
0
votes
2answers
728 views

Using a file input as stdin for a shell script does not work

I have the following script code: test.sh echo "BEGIN" while read CMD <&1; do [ -z "$CMD" ] && continue case "$CMD" in start) echo "get_start" ;; ...
1
vote
2answers
70 views

Drawing interactively from the bash history to construct a complete command?

At the bash prompt the command history can be explored using the up and down arrow keys. (I also often use CTRL+R.) Is it possible to do this without replacing the character string to the left of the ...
2
votes
2answers
2k views

Working with git via crontab

I have the following shell script #!/bin/bash REPODIR=$HOME/work/repository/ cd $REPODIR var=`git fetch --dry-run 2>&1` echo $var > $HOME/error.txt I want to run my script every minute, ...
1
vote
1answer
215 views

Why should I not make each individual shell I run a login shell?

I've been told by numerous people that I shouldn't make each shell I use a login shell. Wether via a TTY, or an Xorg terminal app running bash.. can anyone explain the potential reasoning behind this ...
1
vote
1answer
582 views

run a shell script on terminal if terminal is idle for few minutes in linux

i can get terminal idle time by w command as follows $ w 14:37:58 up 2 days, 20:16, 2 users, load average: 0.12, 0.16, 0.14 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT ...
3
votes
2answers
1k views

Windows 7 & Git Bash: Doesn't Recognize pear/phpunit

I can run pear/phpunit from "cmd" just fine. I checked %PATH% and everything that is there is also in $PATH. To be clear, this is not msysgit -- It is this: http://git-scm.com/downloads Anyone know ...
1
vote
3answers
99 views

Is there more elegant way to find out what's another user's default shell?

Is there more elegant way to find out what's another user's default shell (assuming that I have root privileges and using GNU/Linux)? I'm aware that I can get the answer by looking/parsing/greping/etc ...
1
vote
2answers
9k views

Is it possible to shutdown remote Computers without inputing the password?

I used the following bash to shutdown remote computers,but for each computer,I must input the password for it.Is it possible to input the password Automatically? #!/bin/bash ssh -t root@192.168.1....
0
votes
1answer
534 views

How can I both use and modify the history inside a bash script?

So I have the following bash script aliased as "fortunes": #!/bin/bash -i REPLY=; history -w /tmp/fortunes_history_backup; # save history ... history -c; # and clear it. while [ ! \( "$REPLY" = "q" -...
2
votes
3answers
530 views

Shell script not running as by “./” but it runs by “sh”

I am running a script on arm target board as a super user, i.e., as a root user. But the script is not executing if i run it with following syntax root@freescale$ ./Script.sh -sh: ./Script.sh: ...
-4
votes
2answers
3k views

“rm -rf /” VS. “mv -r / /dev/null”

Might be a stupid question, but what would be the worst for your system ? (I think both) But to my opinion mv would be the fastest to "delete" it all. Am I wrong ? (don't wana test aniway ^^ )
5
votes
4answers
11k views

How to rename multiple files in a directory in some pattern in Linux?

I have a directory which has files with random names. What I want to do is rename the files with file1, file2 and so on.The lexicographically smaller file name should be numbered with smaller number. ...
0
votes
2answers
90 views

How to change the definition of word separators for the shell?

Is there a way to change the definition of the word separators in bash? This will allow me, for example, to do ctrl+w (delete previous word) at the end of this path: /some/path/of/some/file ...
4
votes
1answer
602 views

Bash: color prompt and command differently from output stream

I'd like to color the prompt and command of my shell differently from the text printed in the output stream. My current export for PS1 is as follows: export PS1="\e[0;36m\h:\e[m \e[1;33m\w\e[m\[\033[...