Pages tagged with sh

  • Adobe Flash local storage default settings - Adobe Flash v10 will present the following message when a site wants to store info on your computer: Adobe Flash Player Settings Local Storage s.ytimg.com is requesting permission to store information on your computer. Requested: up to 10 KB Currentl...
  • Bash - Notes about Bash. Run script with a variable taken from lines in a file #!/bin/sh while read line do ls -l $line done < "filenames.txt" List only hidden directories ls -bd .*/ List only hidden directories excluding ./ and ../ ls -bd .*/ |...
  • Redirect stdout and stderr to a file - From Redirect stdout & stderr and append to a file. It is possible to redirect one output channel to another like “2>&1” which means “put the output of channel 2 (stderr) where right now channel 1 (stdout) goes” and ...
  • Hiding stderr or stdout - To hide the standard error (stderr) or standard output (stdout) messages produced by a program, redirect them to /dev/null, a special file that swallows all data written to it. Hide stdout: the_program > /dev/null (Shorthand for the_program 1>...
  • How to use a regex in a bash conditional - Use the double bracket syntax to use regular expressions (aka regex or regexp) in bash conditionals: steph@bpc ~/tmp/bashregextest $ if [[ "foo/bar" =~ ^foo ]]; then echo 'yes'; else echo 'no'; fi yes steph@bpc ~/tmp/bashregextest $ if [[ "foo/bar" =~...
  • Work with filenames listed in a file - If you have a text file with a number of line-seperated filenames, you can do the following to manipulate them: cat thefile.txt | while read line; do ls "$line"; done That example will simply run ls on each filename in the text file.
  • Bash keyboard shortcuts - Some keyboard shortcuts and commands for the Bash. Key sequence Action ctrl-c Kill current process ctrl-z Send current process to background fg return Restore...
Go to top

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top