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
1answer
19 views

What triggers notifications of the form “Bell in session Shell” in KDE?

I'm running KDE on Debian Testing. From time to time, programs running in a terminal (Konsole) trigger system notifications of the form "Bell in session Shell". What triggers these notifications? ...
0
votes
0answers
14 views

Git Bash on Windows 8 open to specific directory except when using Git Bash Here context menu

When I right click and choose Git Bash here it works as expected and the shell launches in the correct window. When clicking just the icon, despite changing the Start In settings, the directory is ...
0
votes
0answers
10 views

Where does device mode and state output come from, and how do I disable it?

Whenever I change my wlan broadcasting details with hostapd I get some output like this: [ 6706.929857 ] device wlan0 entered promiscuous mode [ 6707.986991 ] br0: port 2(wlan0) entered forwarding ...
1
vote
2answers
69 views

Edit xml file using shell script / command

I need to do this using unix script or command There is a xml file in /home/user/app/xmlfiles like <book> <fiction type='a'> <author type=''></author> ...
0
votes
1answer
12 views

What is CMPRS in this top command output?

Processes: 264 total, 2 running, 9 stuck, 253 sleeping, 1229 threads 2015/04/13 17:17:48 Load Avg: 1.00, 1.22, 1.24 CPU usage: 6.36% user, 21.81% sys, 71.81% idle SharedLibs: 14M resident, 16M data, ...
1
vote
1answer
14 views

Make shell script rerun command on certain user input

I'm writing a shell script that randomizes my hostname but prints the random hostname and prompts me if I want to use this hostname for example NEXTHOST=$(sed `perl -e "print int rand(99999)"`"q;d" ...
1
vote
2answers
37 views

Is there a folder-specific .bashrc or .bash_profile?

Is it possible to have a bash script (like a .bashrc or .bash_profile, basically) that is executed only upon cd’ing into a specific folder?
0
votes
1answer
52 views

Looping through files and collecting data

Ok, I have a problem that I think you guys can help with. I have 24 folders. Labeled Angle1, Angle2, ... , Angle24 Each folder has a file name output.txt In each file named output.txt, I want to ...
0
votes
1answer
15 views

Controlling tty / terminal output from other session / shell

We are told that a tty can control at most one session and furthermore that ttys can be controlled not to allow background process groups within its controlled session to write or read from it, the ...
0
votes
1answer
32 views

How to clear screen on Python 3.4.2 shell?

I am trying to clear the screen on python 3.4.2 shell, I used clear screen, clear(), cls, clrscr etc. But no one is working, Please let me know the command to clear the screen.
0
votes
1answer
24 views

How to show path in shell, but only a fixed number from pwd?

Basically, I want to display something like: me@host.serv.com:../projects/1234/source$ cd cpp me@host.serv.com:../1234/source/cpp$ instead of: ...
-1
votes
0answers
19 views

How to run continuous lines in Windows command prompt by setting time limit? [closed]

I want to run continuous lines in Windows command prompt or the place where we enter after pressing simultaneously Window LOGO key and R. Please let me know the command or the way by which I can run ...
2
votes
3answers
62 views

Can I change my PATH dynamically based on my cwd?

I would like to change my $PATH environment variable dependent on my current working directory. Say I'm in /foo/bar/baz and I have the directories /foo/node_modules/.bin and ...
0
votes
1answer
19 views

When in ~ directory, why doesn't ls show /usr/ directory?

I can cd /usr/, but why doesn't ls -a or ls -d or ls -d */ show me that the usr directory is there? I have already seen this question, but ls -d */ yields ls: cannot access */: No such file or ...
1
vote
1answer
25 views

Hiding internal work outputs by shell script

I make a shell script that can update a tools. I want that when i run the root@host:# sh script.sh then the output will be Its installing Its done But now my script look like root@host:# sh ...
0
votes
0answers
9 views

Find history event by prefix with a hyphen

I often have to use commands that have a hyphen in their names and differ only in the part following the hyphen. I am used to using bang-history expansion, but there is a problem with how zsh handles ...
3
votes
3answers
119 views

Prevent fork bomb when using interactive commands (like script) in .bashrc

I've often wanted to log the output of Terminal. So I tried to set script to run at startup; in my .bashrc file I put: script ~/Logs/$(date "+%Y-%m-%d.%H-%M-%S") Because the commands in my .bashrc ...
0
votes
2answers
42 views

chown -R root:root .* in /root performs chown on /

When running the command in the title from /root it somehow jumps up to / and changes ownership for ALLfiles, i only noticed because error messages for /proc popped up. Maybe i'm getting old but ...
2
votes
1answer
25 views

Navigate to the biggest directory in a directory in windows cmd

I am inside a directory which contains two directories - "games" and "music" and I want to descend into either "games" or "music" depending on which one has a bigger size.
0
votes
0answers
22 views

How to pass the command to the other server using ssh

#!/bin/bash ENV=stg NODE=node4 KEYFILE=************ USERNAME=ubuntu PORT=22 HOST=********** CASSANDRA_HOME=/ebs/var/lib/cassandra KEYSPACE=*** TABLE1=RegisterUser TABLE2=EmailSyncMetadata ...
1
vote
1answer
17 views

Custom Windows shell hosted on the network

We have a custom kiosk-style executable that we are using as a shell on Windows 8.1 machines. We'd like to host it on the network so that it's easy to update as desired. The problem we have is that ...
0
votes
3answers
47 views

How do you write to a file within the command line?

Specifically mac, but for future reference for those that come across this post, this could be on any OS. So am learning the command line, and one utility (perhaps the only one) which seems to be ...
0
votes
1answer
24 views

Is it possible to delete directory when in the directory in shell

I have a directory which I run a program in. /usr/bin/my-dir I need to run the program from within the directory So I must go cd /usr/bin/my-dir ./my-program I have a script that from a ...
1
vote
2answers
28 views

Launch interactive shell command as an emacs buffer

I'd like to run a shell command that asks a few interactive questions before proceeding, from within Emacs. The functionality I'm looking for is like xterm -e <command>, only with an Emacs ...
1
vote
1answer
30 views

What is the best policy for running GUI programs from CLI to silence non-error messages?

When, on Linux, running graphical programs (such as Sublime Text for example) from the Terminal, the program runs fine but logs on the console messages that are not exactly failures, nor useful log ...
0
votes
0answers
12 views

Bash history deduplication causing dangerous multi-shell behaviour

I am using the following code in my .bash_profile to filter and de-duplicate my bash history: shopt -s histappend HISTSIZE=100000 HISTFILESIZE=100000 HISTCONTROL=ignoredups:erasedups ...
2
votes
1answer
13 views

How can I safely remove timeout from a script?

I started a script with timeout --signal 2 --kill-after 10 14400 and now decided that it should rather run as long as it must, so I need to remove that timeout from the running script. top -p ...
0
votes
1answer
29 views

How to stop tail -f except using kill

I want to write a shell script to detect if my program starts up successfully. There is a log file created by the program. When the log file contains a new line: Server startup in, then stop the bash ...
1
vote
1answer
34 views

How to call environment variables in runas command for right click context menu

I am having trouble with using environmental variables with using runas when using the command in the registry for a right click context menu command. I have tried different methods of escaping the ...
1
vote
3answers
47 views

How To Quickly Switch Paths (in Bash)

Sometimes, usually when installing packages with brew, I want to disable/remove certain parts of my path, and then later restore them. I haven't been able to find an easy way to do this, and while I ...
2
votes
1answer
13 views

My host offers SFTP only, not SSH. Can I still use private key authentication? i.e., does SFTP use SSH implicitly?

I'm using WP Engine as my host. They are a managed host and they never offer shell access. However, they do allow setup of SFTP accounts. My (limited) understanding is that SFTP still uses an SSH ...
0
votes
2answers
41 views

How to copy file using awk based on time creation to some directory

I trying to copy a file to directory using awk filter based on time creation file #!/bin/bash dir=/home/resaputra23/pyexample/python2/* des=/home/resaputra23/pyexample/backup/ file1= stat $dir | awk ...
0
votes
0answers
13 views

Mac OS X: Shell command for Accessibility -> Sound -> Play stereo as mono? [duplicate]

The question is in the title. I need a quick way to turn the feature on and off every now and then. Is there a bash command for it?
3
votes
3answers
36 views

No path, or command history through SSH when logged in to server as someone other than root

When I SSH into a server, as anything other than root, it only shows a $ and not the path. It also won't allow me to press the up key and see the command history when I don't SSH in as root. How do I ...
2
votes
1answer
16 views

Wrapping `time` (and similar keywords) in call from another script

I have a Bash script (let's call it clock) which should work as a wrapper similar to the time keyword in Bash, e.g. clock ls should do something and then run ls. Here is an example of this script: ...
7
votes
4answers
355 views

Running `exec` with a Bash built-in

I defined a shell function (let's call it clock), which I want to use as a wrapper to another command, similar to the time function, e.g. clock ls -R. My shell function performs some tasks and then ...
2
votes
1answer
22 views

How to save user made zsh shell functions and aliases

Shell beginner here! I'd like to create aliases and functions in zsh shell to speed up my workflow. For example: tw() { open -a //Applications/Textwrangler.app "$*"; } The function itself works, ...
0
votes
0answers
21 views

shell script to change bootloader background

I'm trying to create a shell script on openSUSE to change the bootloader background from the files /etc/default/grub line: GRUB_BACKGROUND=/boot/grub2/themes/openSUSE/background.png with the new ...
2
votes
3answers
41 views

How can I find what a Windows PC thinks its name is, given its IP?

How can I find out what a remote Windows PC thinks its host name is, given its IP? From Windows cmd.exe or a Linux shell. I'm not interested what a DNS server thinks the host name is for an IP, just ...
4
votes
2answers
64 views

How can I issue a command on my local machine from within an SSH session?

Example use case: I am working on my laptop running Mac OS X (A) and am logged into my development server (B) via SSH. I have a script which will generate a GitHub URL for the file/branch I ...
0
votes
0answers
18 views

Execute a .sh file from the desktop in intervalls

We've got a bad hoster, that only allows cronjob in 15 min. intervals. However sometimes we get time critical stuff and we need to do it in faster intervals. That said, the hoster allows an execution ...
1
vote
2answers
38 views

How to make Zsh not store failed command

Problem I'm using oh-my-zsh and Antigen to manage my Zsh. Sometimes I will accidentally enter a wrong/failed command into Zsh and it is very annoying when the zsh-autosuggestions plugin throws up ...
2
votes
1answer
166 views

How to make a bash script that names files with today's date

I'm trying to make a script to back up my we servers, but I have very limited knowledge with bash scripting. I want the script to name the backup file ht-"today's date". How would I go about doing ...
0
votes
2answers
44 views

How to echo string of another string shell variable

We would like to echo the value of a shell variable which has another variable string in its variable name. eg: we want the following output var1=1 var2=2 We tried several various forms similar to ...
0
votes
1answer
47 views

How to disable (and re-enable) notifications on GNOME Shell version 3.8.4 from the command line?

I am running Centos 7 with GNOME-Shell 3.8.4. I can happily disable all notifications from the top-right menu, as pictured: I need to do that from the command line, though, because I need to ...
0
votes
0answers
6 views

Running a slideshow on Ubuntu and and nfs

Seen this question and answer. I need to run a slideshow whose images are hosted on an nfs. Would this snippet of code while true ; do for i in * ; do cp "$i" ~/slideshow.jpg ; echo $i ; sleep 5 ; ...
1
vote
1answer
26 views

Can't find the good Cygwin shell executable

I am working on Windows 7 and I need Cygwin for my project. I am trying to launch the Cygwin terminal from a Java programm and then write command lines but my problem is that I can't find the right ...
1
vote
1answer
20 views

Windows 7 system resource as folder name

I hope it is not a stupid question, but is it possible to set a folder name to a system32.dll localised string resource? I can set the icon easily on the properties window (eg. from imageres.dll), but ...
0
votes
1answer
18 views

Remove a specific string common in multiple lines in a CSV file using shell script

I have a CSV file which contains 65000 lines (size approximately 28 MB). On each of the lines they have a path in the beginning in the format of: c:\abc\bcd\def\123\456. Now let's say the path ...
0
votes
2answers
32 views

Redirect stderr to second terminal / tty

I've tried things like rse to differentiate standard-output and standard-error streams from a program; but I'd really like the option of viewing the two in separate terminals, without redirecting to a ...