nl
stringlengths
13
387
bash
stringlengths
1
532
Read a single character from standard input into variable "key" without backslash escapes, with a timeout of 5 seconds, and with the prompt "Press any key in the next five seconds..."
read -t5 -n1 -r -p 'Press any key in the next five seconds...' key
Read a single character from standard input into variable "runCommand" with the prompt "Pick a letter to run a command [A, B, or C for more info] "
read -n1 -p "Pick a letter to run a command [A, B, or C for more info] " runCommand
Read a single character from standard input with delimeter '' and no echo
read -d'' -s -n1
Read a single character from standard input with prompt "Are you sure? (y/n) "
read -p "Are you sure? (y/n) " -n 1
Read a single character from standard input with prompt "Are you sure? "
read -p "Are you sure? " -n 1 -r
Read a single character from standard input with prompt "Is this a good question (y/n)? " and timeout of 3 seconds and save the response to variable "answer"
read -t 3 -n 1 -p "Is this a good question (y/n)? " answer
Read a single character from standard input with prompt "Is this a good question (y/n)?" and save the response to variable "answer"
read -n 1 -p "Is this a good question (y/n)? " answer
Read a single line from standard input and save to variable "line"
read line
read all history lines not already read from the history file
history -n
Read the first 10 characters from standard input in an interactive shell into variable "VAR"
read -n10 -e VAR
Read hexadecimal bytes from device "/dev/midi1"
od -vtx1 /dev/midi1
Read the history file $HISTFILE and append the contents to the history list
history -r "$HISTFILE" #Alternative: exec bash
Read the history file and append the contents to the history list
history -r
Read line from file descriptor 4 and store received input in 'line' variable
read -u 4 line
Read lookup requests from text file '1.txt' and uses them to fetch TXT records.
dig TXT -f 1.txt
Read one character from standard input into variable "REPLY"
read -n 1 -r
Read one character from standard input into variable "REPLY"
read -n1
Read the raw input of "/dev/input/mice" as hexadecimal bytes with 3 bytes per line
cat /dev/input/mice | od -t x1 -w3
Read standard input until a null character is found and save the result in variable "line"
read -d '' line
Read standard input until a null character is found and save the result in variable "line"
read -r -d $'\0'
Read yesterday's date with format "%a %d/%m/%Y" into variable "dt" in a subshell
date --date yesterday "+%a %d/%m/%Y" | read dt
recall the second argument from a previous command by pressing alt-shift-y
bind '"\eY": "\e2\e."'
Receive input and print it to terminal
cat
Receive input and print it to terminal preceeding with line number
cat -n
Receive pattern to search for on the standard input and print only matching part of lines from file 'f.html'
cat f.html | grep -o \
Records the number of occurences of 'needle' in the array 'haystack' into the variable 'inarray'
inarray=$(echo ${haystack[@]} | grep -o "needle" | wc -w)
Recursively add ".jpg" to all files in the current directory tree
find . -type f -exec mv '{}' '{}'.jpg \;
Recursively add ".jpg" to all files without an extension in the directory tree "/path"
find /path -type f -not -name "*.*" -exec mv "{}" "{}".jpg \;
Recursively add read and directory access to all permissions of all files and directories
chmod -R a+rX *
Recursively add read and execute permissions to all files and folders in "directory"
chmod -R +xr directory
Recursively add user write permission to all files under "/path/to/git/repo/objects"
chmod -Rf u+w /path/to/git/repo/objects
Recursively and forcibly removes $TMP folder with all content.
rm -fR "${TMP}/";
Recursively archive "test/a/" to "test/dest" excluding "test/a/b/c/d"
rsync -nvraL test/a/ test/dest --exclude=/b/c/d
Recursively change "/usr/local" owner to the current user and group to admin
sudo chown -R $(whoami):admin /usr/local
Recursively change all permissions under "theDirectory/" to 777(read,write,execute for all users)
sudo chmod -R 777 theDirectory/
Recursively change the group of all files in "/tmp/php_session" to "daemon"
chown -R :daemon /tmp/php_session
Recursively change the group of all files in "/var/lib/php/session" to "lighttpd"
chown -R :lighttpd /var/lib/php/session
Recursively changes group ownership of the $PATH_TO_OUTPUT_FOLDER directory to $GROUP group.
chgrp -R $GROUP $PATH_TO_OUTPUT_FOLDER
Recursively changes group ownership of every file in '/var/tmp/jinfo' to 'www-data'.
chgrp -R www-data /var/tmp/jinfo
Recursively changes group ownership of everything in '/home/secondacc/public_html/community/' to 'fancyhomepage'.
chgrp -R fancyhomepage /home/secondacc/public_html/community/
Recursively changes group ownership of everything in 'files' to 'apache_user'.
chgrp -R apache_user files
Recursively changes group ownership of everything in 'files' to 'my_group'.
chgrp -R my_group files
Recursively changes group ownership of everything in a '/home/user1/project/dev' folder to 'project_dev'.
chgrp -R project_dev /home/user1/project/dev
Recursively changes group ownership of everything within '.git' to 'git'.
chgrp -R git .git
Recursively changes group ownership of everything within '/git/our_repos' to 'shared_group'.
chgrp -R shared_group /git/our_repos
Recursively changes group ownership of everything within a current directory to 'repogroup'.
chgrp -R repogroup .
Recursively changes group ownership of everything within a current folder and having group 'X_GNAME' to 'Y_GNAME'.
find . -group X_GNAME -exec chgrp Y_GNAME {} +
Recursively changes group ownership of everything within current folder to 'git'.
chgrp -R git ./
Recursively changes group ownership on every file in the ${WP_ROOT}/wp-content directory to ${WS_GROUP} group.
find ${WP_ROOT}/wp-content -exec chgrp ${WS_GROUP} {} \;
Recursively changes group ownership on everything in the 'public_html' folder to 'website' group.
chgrp --recursive website public_html
Recursively change the group ownership to "laravel" in "./bootstrap/cache"
sudo chown -R :laravel ./bootstrap/cache
Recursively change the group ownership to "laravel" in "./storage"
sudo chown -R :laravel ./storage
Recursively change the owner and group of "/home/el/svnworkspace" and "775" to "your_user_name"
chown -R your_user_name.your_user_name 775 /home/el/svnworkspace
Recursively change the owner and group of "/opt/antoniod/" to "antoniod"
chown -R antoniod:antoniod /opt/antoniod/
Recursively change owner and group of "/usr/local/rvm/gems/ruby-2.0.0-p481/" to the current user
sudo chown $(whoami):$(whoami) /usr/local/rvm/gems/ruby-2.0.0-p481/ -R
Recursively change the owner and group of "/var/antoniod-data/" to "antoniod"
chown -R antoniod:antoniod /var/antoniod-data/
Recursively change the owner and group of "/workspace" and "775" to "your_user_name"
chown -R your_user_name.your_user_name 775 /workspace
Recursively change the owner and group of "subdir1" to "user1"
chown user1:user1 -R subdir1
Recursively change the owner and group of "subdir2" to "user2"
chown user2:user2 -R subdir2
Recursively change the owner and group of "subdir3" to "user3"
chown user3:user3 -R subdir3
Recursively change the owner and group of "~/.ssh/" to "dev_user"
chown "dev_user"."dev_user" -R ~/.ssh/
Recursively change the owner and group of all files in "/your/directory/to/fuel/" to "nginx"
chown nginx:nginx /your/directory/to/fuel/ -R
Recursively change the owner and group of all files in the current directory to "andrewr"
chown -R andrewr:andrewr *
Recursively change the owner and group of all files in the current directory to "apache"
find . -maxdepth 1 -not -name "." -print0 | xargs --null chown -R apache:apache
Recursively change the owner and group of all files in the current directory to "apache"
ls | xargs chown -R apache:apache
recursively change owner and group of the directory /opt/antoniod/ to user and group antoniod
chown -R antoniod:antoniod /opt/antoniod/
recursively change owner and group of the directory /your/directory/to/fuel/ and all files into it to user and group nginx
chown nginx:nginx /your/directory/to/fuel/ -R
recursively change owner and group of the directory and all files into it to user "user" and group "www-data"
chown -R user:www-data yourprojectfoldername
recursively change owner and group of the directory and all files into it to user root and group root
chown -R root:root /var/lib/jenkins
recursively change owner and group of the directory and group of the directory and all files into it to user and group dev_user
chown "dev_user"."dev_user" -R ~/.ssh/
Recursively change owner and group to "$JBOSS_AS_USER" of "$JBOSS_AS_DIR"
chown -R $JBOSS_AS_USER:$JBOSS_AS_USER $JBOSS_AS_DIR
Recursively change owner and group to "$JBOSS_AS_USER" of "$JBOSS_AS_DIR/"
chown -R $JBOSS_AS_USER:$JBOSS_AS_USER $JBOSS_AS_DIR/
Recursively change owner and group to "tomcat7" of "webapps", "temp", "logs", "work", and "conf"
chown -R tomcat7:tomcat7 webapps temp logs work conf
Recursively change the owner of all "*.txt" files under "/mydir" to "root"
find /mydir -type f -name "*.txt" -execdir chown root {} ';'
Recursively change the owner of all files in "/usr/local/lib/node_modules" to the current user
sudo chown -R $USER /usr/local/lib/node_modules
Recursively change the owner of all files in "testproject/" to "ftpuser"
chown ftpuser testproject/ -R
Recursively change the owner of all files in "upload_directory" to "nobody"
chown -R nobody upload_directory
recursively change owner of the directory /Users/xxx/Library/Developer/Xcode/Templates and all files to user xxx
sudo chown -R xxx /Users/xxx/Library/Developer/Xcode/Templates
recursively change owner of the directory /tmp to the current user
sudo chown -R $USER ~/tmp
recursively change owner of the directory /usr/local to the current user
sudo chown -R `whoami` /usr/local
recursively change owner of the directory /usr/local/lib to the current user
sudo chown -R `whoami` /usr/local/lib
recursively change owner of the directory and all files into it to user nobody
chown -R nobody upload_directory
recursively change owner of the directory testproject and all files into it to user ftpuser
chown ftpuser testproject/ -R
recursively change owner of the directory ~/.npm to the current user
sudo chown -R $(whoami) ~/.npm
Recursively change owner to "$1" and group to "httpd" of all files in the current directory
chown -R $1:httpd *
Recursively change the owner to "$USER" and group to "$GROUP" of "/var/log/cassandra"
sudo chown -R $USER:$GROUP /var/log/cassandra
Recursively change owner to "amzadm" and group to "root" of all files in "/usr/lib/python2.6/site-packages/"
chown amzadm.root -R /usr/lib/python2.6/site-packages/
Recursively change the owner to "ec2-user" and group to "apache" of all files in "/vol/html"
sudo chown -R ec2-user:apache /vol/html
Recursively change owner to "tomcat6" of "webapps", "temp", "logs", "work", and "conf"
chown -R tomcat6 webapps temp logs work conf
Recursively change the owner to "user" and group to "www-data" of "yourprojectfoldername"
chown -R user:www-data yourprojectfoldername
Recursively change owner to "www-data" of "/var/www/.gnome2", "/var/www/.config", and "/var/www/.config/inkscape"
chown -R www-data /var/www/.gnome2 /var/www/.config /var/www/.config/inkscape
Recursively change ownership of "/usr/lib/node_modules/" to the current user
sudo chown -R $(whoami) /usr/lib/node_modules/
Recursively change ownership of "/usr/local" to the current user
sudo chown -R `whoami` /usr/local
Recursively change ownership of "/usr/local/lib/node_modules" to the current user
sudo chown -R `whoami` /usr/local/lib/node_modules
Recursively change ownership of "~/.npm" to the current user
sudo chown -R $(whoami) ~/.npm
Recursively change ownership of "~/.npm" to the current user
sudo chown -R `whoami` ~/.npm
Recursively change the ownership of all directories in the current directory excluding "foo" to "Camsoft"
ls -d * | grep -v foo | xargs -d "\n" chown -R Camsoft
Recursively change the user and group of all files in "/var/cache/jenkins" to "root"
chown -R root:root /var/cache/jenkins
Recursively change the user and group of all files in "/var/lib/jenkins" to "root"
chown -R root:root /var/lib/jenkins
Recursively change the user and group of all files in "/var/log/jenkins" to "root"
chown -R root:root /var/log/jenkins