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

learn more… | top users | synonyms

4
votes
2answers
671 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
167 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
2k views

How to use updatedb command as an ordinary user?

The locate command is very useful tool on Linux, but it seems only root can run updatedb command which is very unconvinent to use it. So how to make ordinary user to have the priviledge to run ...
4
votes
2answers
361 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
235 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
2k 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
72 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
184 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
149 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
145 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
595 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 ...
3
votes
1answer
537 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
1k 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
156 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
180 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 ...
1
vote
2answers
103 views

Is there a tool/command to reconnect a SSH

I often need to ssh to a build machine (on ubuntu) for building software. But sometime, my connection to the machine is disconnected (e.g. due to Wifi not stable). Is there anyway I can 'reconnect my ...
5
votes
3answers
4k views

Can I use pipe output as a shell script argument?

Suppose I have a bash shell script called Myscript.sh that need on argument as input. But I want the content of the text file called text.txt to be that argument. I have tried this but it does not ...
3
votes
2answers
2k views

Get exit code from subshells that are running in parallel

I try to make a shell script to launch a serie of long-runner processes. Let's call them a, b, c, d and e. Processes b, c and d should run in parallel, and process e must run after all of the previous ...
0
votes
1answer
70 views

Count amount of disk space needed by files bigger than x

In Linux, I know I can use find ./ -size +1M to find files which are bigger than 1M, but how do I sum the total space needed by these files?
2
votes
1answer
289 views

Using both “source” and “&” in bash

I was just reading up on how Unix shells work (bash in particular), and I tried something that didn't make sense to me. As I understand it, the source command runs the program you give it in the ...
1
vote
3answers
605 views

How to mount/umount disk in console to get the same result as nautilus?

In nautilus, a disk can be mounted by mouse click, the results are format(NTFS) is recognized correctly read/write are permitted by non-root user You can also umount a disk without root ...
0
votes
2answers
190 views

Ignore variables from another shell

I am on a linux workstation in a network, with an "old" distrib. Furthermore, login shell is enforced to CSH. I already asked to Admins if it would be possible to switch to another one (I would like ...
7
votes
1answer
2k views

ZSH tab completion of git commands is very slow. How can I turn it off?

If I type: rm <TAB> I'll see possible completions almost instantly. However, if I type: git rm <TAB> It'll hang for several seconds if it's in a git repo, or fail to show any ...
0
votes
1answer
149 views

Shell access without forwarding ports

This may be a stupid question but can you obtain shell access to a web server by means of not forwarding any ports? I am at work and can't forward any ports to allow access. Are there alternatives? ...
3
votes
2answers
392 views

SQLITE3 for dummies - solved (sort of)

I'm trying to learn the SQLite with "sqlite3 -interactive" shell (under Cygwin). For supposedly all legal reasons the sqlite3 shows the following prompt every time I forget to add a semicolon at the ...
1
vote
1answer
683 views

Order of execution and purpose of .profile vs .zshrc

Few questions: What is a distinct purpose of .profile and .zshrc? What gets called first when the shell comes to life?
-2
votes
3answers
148 views

How can I get a list of commands used for navigating in the terminal?

In the terminal, what should I type to show a list consisting of command items such as these: ls: show direcrtory cd: move to directory … and so on. What command can you use to display this list? ...
2
votes
2answers
123 views

Can I use an ssh client or something similar to run commands on the local machine from a remote machine?

I have a machine which I cannot ssh into. I would like to be able to have controll a shell session in it. Is there some way to have it connect out to another machine and for me to issue commands on ...
3
votes
1answer
88 views

how to make getopts just read the first character post `-` [closed]

I have a shell script testShell.sh which uses getopts as below: #!/bin/bash while getopts ":j:e:" option; do case "$option" in j) MYHOSTNAME=$OPTARG ;; e) SCRIPT_PATH=$OPTARG ;; ...
1
vote
1answer
837 views

Does Linux save the history of executed commands

I know we can do a "history" command or use control+R to find the command history in a particular shell session. But is there a way to find out the command history of my last ssh session for example? ...
1
vote
2answers
542 views

is there an 'upwards' find?

I found I asked this question on the wrong stackexchange site. To find files starting from a certain path, I can use find <path> .... If I want to find 'upwards', i.e. in the parent directory, ...
4
votes
2answers
359 views

What's DING!? Shell prompt with time in it

I am using tcsh shell. I put time in my shell prompt. It shows me DING! sometimes, what's up with that? /home/snihalani on master at 2:55pm => /home/snihalani on master at DING! => ...
1
vote
2answers
245 views

Combined sudo su deploy command doesn't work, does when separate

I have this command: ubuntu@ip-10:~$ sudo su deploy -c 'rvm install 1.9.3' bash: rvm: command not found I also tried: ubuntu@ip-10:~$ sudo su deploy -c 'source /home/deploy/.bashrc && rvm ...
9
votes
2answers
7k views

How can I found out if file is alias or symbolic link?

I'm working on a legacy system and I have a bunch of files that are referencing images that are located in other folders. lrwxrwxrwx 1 user nobody 56 Feb 10 2010 t100x100.jpg -> ...
0
votes
2answers
312 views

exclude files from list that begin by string in unix

I'm using s3cmd top copy files to S3 but I want to exclude all files that begin with 00 and are a JPEG. I'm trying --exclude=00*.jpg with no success. Any idea how to do this?
3
votes
1answer
471 views

How to specify for emacs tramp which remote shell to open?

Besides opening remote files, tramp can be used to run a remote shell. Unfortunately, there is a problem. On a local machine i have zsh and on remote server only bash is installed. Issuing M-x shell ...
0
votes
1answer
194 views

How do I configure gvim to open files from the current directory?

On Windows, no matter what I set as the current directory, gVim will always set its initial working directory to $home. (That is, if I launch gVim with the current directory at C:\something, or if I ...
0
votes
1answer
73 views

Segmentation fault when running bib2x

I'm working on an unfamiliar machine and I am trying to get a program called bib2x to work. Unfortunately, when I run the program, I keep getting a segmentation fault. My (limited) experience and ...
5
votes
2answers
1k views

How to copy files on unix shell using wildcards

I'm trying to copy some files into existing folders. This is an example of the schema # origin /home/user/myfiles/folder1/group1/1.jpg /home/user/myfiles/folder1/group1/2.jpg ...
3
votes
2answers
913 views

Command prompt takes 7-8 seconds to load in Windows 7

When I go to Run and type cmd, it takes about 7-8 seconds for the command prompt to appear. I have a Core i5 with 3GB of RAM running Windows 7 x86. I really need the command prompt to run instantly ...
5
votes
1answer
54 views

How can I suspend a whole command sequence in a shell?

How can I suspend a whole command sequence in bash or zsh (or maybe some other shell)? For example, if I run: sleep 100; echo foo and press Ctrl + Z, sleep is suspended and put into background, ...
0
votes
1answer
1k views

How to prevent Shell auto-logout from terminating my screen session?

c shell and echo $autologout shows 60 But I can not unset this variable since it`s read-only, error message: set: $autologout is read-only. Everytime when the shell is auto logged out, my screen ...
9
votes
3answers
1k views

bash: colorized man page

Where do I have to take a look at in the system to colorize the man pages? The man pages are viewed with less, so I tried adding the following lines to my .bashrc to change the colors: (Which works ...
7
votes
3answers
2k views

How to run Vim command from the shell?

This might be a dumb question, but bear with me. I'm automating some of the usual stuff I do when setting up a new work environment, and would like to automate the Vim command :BundleInstall (for ...
18
votes
3answers
12k views

What is the difference between CMD and Command prompt in windows?

Until now, I never thought (and never observed) that cmd and command are two different things. Well, are they? Take a look at this pic: Actually, I usually open cmd from the Run dialog whenever I ...
-1
votes
2answers
4k views

copying file from local machine to remote server using ssh

How do I copy a file from my local machine to a remote server using ssh, I have tried the following code: scp -o StrictHostKeyChecking=no -r $tarpath/$user@$server:$perfresdir/temp/ACK/
2
votes
3answers
4k views

Linux Ubuntu 12.04 high Load without high cpu/ram usage. Which tools and techniques to diagnose/solve this?

I'm having a huge load after install Linux Ubuntu 12.04 My machine now is a Intel G620/4G RAM/ 1T HD, before it was a Amd X2 5000/4G RAM/250G HD Now uptime in idle mode: 12:45:03 up 3 days, ...
4
votes
2answers
1k views

Does the Linux 'nice' command work on any shell script?

Does nice work on any shell script, or does it work on basic Linux commands only? For example, if I have a custom shell script that contains a sort function, and I call nice myscript.sh would ...
0
votes
1answer
305 views

Cygwin shell is overriding my Windows shell

I'm not sure what I did, but I've somehow got Cygwin installed in such a way that even when I try to run an ordinary windows shell, Cygwin is interfering. I have batch scripts that I want to run in ...