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

learn more… | top users | synonyms

1
vote
2answers
67 views

Copy a line of text to a file and numbering it

I want to make several copies of a line of text, following a numeric order. exampleline: exampleline1 exampleline2 exampleline3 etc.. What's the basic way to get the desired number of copied lines ...
2
votes
1answer
6k views

How to turn the laptop built-in webcam on/off from shell

Fn+F6 key combination turns my laptop's integrated web camera on/off. Looking at the dmesg output, it seems that the webcam (USB device) is being more or less virtually connected/disconnected to/from ...
1
vote
1answer
338 views

Remove path until slash when typing in terminal

For instance, when I type a path in terminal cd project/example/one I can press Ctrl+W and remove the entire "word" project/example/one. Sometimes it's not very useful. Are there any shortcuts for ...
4
votes
2answers
4k views

Why can't I highlight text in a linux terminal emulator with shift+arrow keys?

These are the standard text editing keyboard shortcuts that I use constantly whenever editing text in, literally, any linux application other than terminal emulators: left+right arrows to move ...
0
votes
1answer
173 views

csh bindkey what is “\346”

It looks like I cannot use Ctrl+right_arrow to forward word on my c shell. After some effort I found out that the all the key bindings can be found with bindkey command and I get these: "\306" ...
0
votes
2answers
83 views

Equivalents for .bat files for starting a jar file

Which are the .bat file alternatives for Linux, MacOSX and other operating systems for starting a jar file for example or another program (.exe, .app ...) with a click on this .bat / ... file? I just ...
2
votes
1answer
3k views

Shell Script to GZIP files without overwrite .gz files

I'm trying to create a shell script which receive as first parameter of a path to a folder which I would like to compress all files using gzip without overwrite the .gz files that already exist in ...
2
votes
3answers
188 views

Is there a command line equivalent to cut and paste metaphor for files?

Context: I am navigating around in folders, and finding files I need. I would like to copy my files somewhere to place them somewhere else. But I don't want to have to deal with trying to figure out ...
1
vote
0answers
104 views

Why is there a long delay when using `nohup` on Linode

I have a shell script like: for((i=1;i<500;i++)) do python get_sequence.py done I want to run it on a Linode VPS. It would take a few days to run, so I'm going to use nohup ./run.sh &, so ...
1
vote
1answer
165 views

put in bash or zsh history absolute path to files I working on

I have found that in bash i frequently use something like that: vim ./somefile1 less less ./dir1/dir2/somefile2 cp some_other_relative_path_to_file and so on After that when I trying to find a ...
1
vote
2answers
571 views

“Export” vim syntax highlighting to output to shell?

Is there some program that can parse vim syntax highlighting scripts and colorize code for export to the shell? Basically I am looking for cat/less with shell highlighting that draws its syntax from ...
4
votes
1answer
184 views

Color in Bash Prompt messing up the prompt

In my bashrc file I have my prompt set as follows: TC_GRE="^[[0;32;40m" TC_RESET="^[[0m" ...
0
votes
1answer
215 views

How do I run a shell script with export command in crontab?

I have a shell script that exports values of variables when executed. The same values will be used in another script. #!/bin/sh export I="10" echo $I I will be using root access for cron. I ...
0
votes
2answers
1k views

Delete files of a particular date in unix?

I have to delete files of yesterday, I am doing something like this ls -l | grep 'Feb 15'|awk| xargs I cant use awk, since my file names have spaces in them, so I cant separate them in the output ...
0
votes
3answers
4k views

Create a bootable pen drive through Linux command line

Can I make a bootable pen drive from a ISO using the Linux command line without installing any extra software? If yes, what are the commands?
0
votes
1answer
578 views

csh -> bash, autostart .bashrc PCBSD (FREEBSD)

Hey Im stucked with this problem... Im using PCBSD (freebsd) which has default csh shell, now I wanted to use bash as a default so I made > chsh -s /bin/bash milo now i have in passwd > ...
0
votes
2answers
232 views

Putting code into registry command key

I'm trying to do what's done in this question, but I want to attach it to a context menu on Directory so I can right-click on "Flatten Folder" and have it do it for me. That is, bring all the ...
19
votes
5answers
15k views

How can I find the oldest file in a directory tree

I'm looking for a shell one-liner to find the oldest file in a directory tree.
1
vote
2answers
283 views

formatting of the diff output

I have 2 files that I want to differ. File B is produced appending some new line to file A. I want to highlight the appended data by using diff. I would like to avoid printing out the '>' characters ...
0
votes
1answer
45 views

The exact workflow of PVM (Parallel virtual machine)

These days I am learning PVM technology for concurrent processing. I go through so many blogs, tutorials to understand . Yes, I got some points, but no one gives me clear workflow of how it perform ...
1
vote
1answer
393 views

Applescript to shell script watch folder

I am trying to setup a watch folder so that when a file is added to a folder, I can run a shell script...for this purpose I made a simple test but cannot make it work... Here is my applescript on ...
2
votes
0answers
196 views

shell script ffmpeg stops after 2 jobs [closed]

I have a pretty simple shell script and after doing the first two jobs, it just stops and sits there, doesnt do anything, it doesnt seem to matter what the third job is, if I switch the order etc, it ...
0
votes
1answer
132 views

Making an alias for `tree -P '*name*'`

I'm creating an alias for the following command with the tree program: tree -P '*name*' This works exactly as I want. But when I create an alias for this command, the command behaves differently: ...
0
votes
1answer
27 views

Cannot start a script

#!/bin/bash value=$(<man.txt) echo "$value" if [ "$value" == "true" ]; then echo "startedif_manthan" ps -ef|grep sym |awk '{ print $2 }'|sudo xargs kill -9; sleep 30; sudo sh ...
2
votes
1answer
345 views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
0
votes
0answers
25 views

Different behavior from ubuntu server and ubuntu client on windows

#!/bin/bash # Reading cat /home/radiare/Desktop/first.txt | while read LINE do echo $LINE if [ "$LINE" == "false" ]; then echo "Inside first loop" break fi done echo "second file read started" cat ...
1
vote
1answer
194 views

Automatic file encryption/decryption: detect file is closed in Mate/Gnome application

I'm writing a bash script to automatically decrypt file for editing and encrypt it back after file is closed. File type could be any: plain-text, office document, etc. I am on Linux Mint with Mate. ...
1
vote
1answer
105 views

How to remove unwanted characters when running command in terminal

I'm using zsh with oh-my-zsh as default shell. When I run a command in guake / gnome-terminal / konsole, a string with format (special-char|command-name|%) appears as the first line of output in ...
2
votes
2answers
291 views

Why shell commands for PNG file in Windows 8 doesn't work?

I have exactly same task like here: Windows 7 - Add shell command for .png file But this solution doesn't work in Windows 8 for unknown reason only for PNG files. And I don't know why. I tried some ...
4
votes
1answer
731 views

What file is used during login on Unix?

When you log in to a shell on a Unix system there are usually some files that are run in your home directory. You'd use these to, for example, set up aliases and additions to your $PATH. But, how do ...
4
votes
3answers
58 views

Show Which Remote File is Writing My File

I know it sounds funny. I wrote a shell script and executed on a remote machine to ssh back to my local machine to write some files. I executed the script on various remote machines and I can't ...
2
votes
1answer
553 views

In tmux, arrow and ctrl+arrow both result in the same code

Ubuntu 12.10, TERM is set to screen-256color in putty and tmux.conf, confirmed when I export both in and out of a tmux session. If I run cat > /dev/null and then press <down> then ...
1
vote
2answers
384 views

Can not stat over a file name having space in it

I m very new to shell scripting and writing a script for a project. I am having a problem while doing "stat" on a file name, to check size, which has spaces in it. The problem is that I can not write ...
1
vote
2answers
318 views

Extract a number from a column with Bash

I need to extract only bash script_c.sh process' number, from this output: 11545 pts/3 S+ 0:00 bash script_c.sh 11625 pts/3 S+ 0:00 grep script_c.sh in this case it will be: 11545 I ...
2
votes
1answer
805 views

How can I list directories first in the terminal with zsh / ls command in Mac OSX?

Most of the similar questions / answers here don't work in Mac/OSX because there is not such a thing as --options. I am using the ZSH shell, I've been trying commands said here: ...
0
votes
1answer
322 views

Combining multiple data files with header while also adding a data column

I have multiple tab delimited data files that are separated by month in the format jan06.txt, feb06.txt, ..., dec07.txt. Within each file, it looks something like: Header1 Header2 Header3 ... Data1 ...
2
votes
3answers
1k views

Vim + iTerm2 color issues

I have trouble with the right Vim configuration. I'm using the latest version of Vim as well as the latest version of iTerm2. I try to get the solarized colorscheme working, but without luck so far. ...
1354
votes
7answers
146k views

How do I make a machine “blank screen” for a period of time (as a penalty) if certain noise levels are reached?

My kids (4 and 5) yell a lot when playing games on the computer. I found an effective cure for this. When I hear loud noises, I ssh into the game computer and do: chvt 3; sleep 15; chvt 7 This ...
1
vote
1answer
1k views

how to connect to secured wireless network connection in cmd in windows?

I program on C#, I don't want to use P/invoke, so I will use shell, so I need to connect to a secured wireless network connection on the CMD in windows, I know how to connect to a wireless network but ...
1
vote
1answer
86 views

Testing vimscript

I'm hacking on a test framework for vimscript (an exercise in futility, I know; humor me). Some vim plugins make calls out to the shell (with the system() function or the ! command). I want the test ...
1
vote
4answers
864 views

Unable to make bash default shell in freebsd

I wanted to change my default shell to bash in freebsd. I tried the following: 1.chsh -s /bin/bash (or /usr/local/bin/bash) <my_username> I get this error after entering the password: chsh: ...
7
votes
1answer
10k views

When using “gzip --decompress”, the result is “gzip: MYFILE.zip: unknown suffix — ignored” on Windows

In Windows PowerShell (if it matters), I would like to decompress a zip file with gzip with the argument --decompress, but unfortunately it doesn't work. Please look at the screenshot below. gzip ...
0
votes
3answers
914 views

Shell script works directly, but has a syntax error via crontab

I have a shell script to automate a git commit and push every night: auto_git_push.sh #!/bin/sh function automate(){ git add . git commit -am "automated push $(date +"%Y-%m-%d")" git ...
2
votes
3answers
2k views

What's a reliable technique for killing background processes on script termination?

I use shell scripts to react to system events and update status displays in my window manager. For example, one script determines the current wifi status by listenining to multiple sources: ...
4
votes
1answer
2k views

What are commands to find shell keywords, built in functions and user defined functions?

I was discussing with my friend on how the commands are parsed in the shell, and he told me that bash searches the command in following order List of aliases List of shell keywords List of user ...
3
votes
2answers
135 views

Do aliases slow down a shell's start?

Sometimes my shell (zsh) takes longer to start than usual (I open the terminal, and it hangs a bit until I can input commands). I have a few aliases on my .zshrc (well, actually they're in a ...
6
votes
3answers
1k views

what does it mean a red filename shown with black background?

I have a compilation problem, and when I check my lib/ directory I get this output from "ls": What the red/black combination mean? I checked in the output of "dircolors -p" as suggested here ...
0
votes
1answer
183 views

Passing User's aliases to root while doing “sudo su”

Is it possible? I could make an alias to sudo su -;source .bashrc but it seems like source .bashrc is executed in the earlier shell and not in root's sheel (Why?)
2
votes
1answer
1k views

How to redirect multiple bash commands to a variable AND screen?

I would like to capture a subshell's output in a variable and print it in the terminal screen simultaneously. Is it possible to do this by assigning the subshell to a variable and piping stdout and ...
3
votes
2answers
130 views

Very Simple Script to Remove Last 5 Lines of a Series of Text Files

For some reason this script outputs three files for each original, rather than one. Must have made some trivial error - I'm new to this! Much obliged if anyone could explain why this happens. ...