nl
stringlengths
13
387
bash
stringlengths
1
532
Create a rsa key of 2048 bits with comment "michael" and store it in file "key".
ssh-keygen -b 2048 -t rsa -f key -C michael
create a soft link of the files in the folder /media/movies which have been modified in the last 30 days
find /media/Movies -type f -mtime -30 -exec ln -s {} /media/Movies/New/ \;
Create a ssh key and store it in the file ~/.ssh/apache-rsync
ssh-keygen -f ~/.ssh/apache-rsync
Create a ssh key of RSA type, and prompt for a filename to store it, presenting the default for this type of key as $HOME/.ssh/id_rsa
ssh-keygen -t rsa
Create a ssh tunnel on local port 2222 through "bridge.example.com" to "remote.example.com" port 22 without executing any commands and run in the background
ssh -N -L 2222:remote.example.com:22 bridge.example.com&
Create a symbolic link in "/bar/tmp/" for each file in directory "/foo" that does not start with "runscript"
find /foo -maxdepth 1 -type f ! -name 'runscript*' -exec ln -s {} /bar/tmp/ \;
Create a symolic link in "/usr/local/" to "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/
Create a symolic link in "/usr/local/bin/" to "/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl"
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/
Create a symbolic link in the current directory for each .jpg file under "dir"
ln -s "$(find dir -name '*.jpg')" .
Create a symbolic link in the current directory for each file .dbf under the directories matching "/home/michael/foxpro/mount/A[1FV]/[12][0-9][0-9][0-9]"
find /home/michael/foxpro/mount/A[1FV]/[12][0-9][0-9][0-9] -name '*.dbf' -type f -exec ln -s {} \;
Create a symbolic link in the current directory for each file under the directories matching "../[12][0-9][0-9]"
find ../[12][0-9][0-9][0-9] -type f -exec ln -s {} \;
create a symbolic link in current directory named "environments" to file "../config/environments"
ln -s "../config/environments"
create a symbolic link in current directory named "my_db" to file "/media/public/xampp/mysql/data/my_db"
ln /media/public/xampp/mysql/data/my_db -s
Create a symbolic link in the current directory to "../config/init"
ln -s "../config/init"
Create a symbolc link in the current directory to "target"
ln -s target
Create a symbolic link in directory "/path/to/dir" for each file and directory under the current directory starting with "."
find $PWD -name '.[^.]*' -exec ln -s '{}' /path/to/dir \;
Create a symbolic link in directory "new" for each file in "original" directory tree
find original -type f -exec ln -s {} new/{} \;
Create a symbolic link in directory "~/newlinks" for each file listed in "results2.txt"
cat results2.txt | xargs -I{} ln -s {} ~/newlinks
Create a symbolic link in target directory "$tmpdir" for each file under the current directory
find $PWD -type f -exec ln -st $tmpdir {} +
Create a symbolic link named "$1/link" to the current working directory
ln -s "`pwd`" $1/link
Create a symbolic link named "$1/link" to the existing full and real path of "$2"
ln -s "$(readlink -e "$2")" "$1/link"
Create a symbolic link named "$HOME/bin/" to "$HOME/downloads/fnord"
ln -s $HOME/downloads/fnord $HOME/bin/
create a symbolic link named "$ORACLE_HOME/include" to file "/usr/include/oracle/11.2/client"
sudo ln -s /usr/include/oracle/11.2/client $ORACLE_HOME/include
Create a symbolic link named "$SYMLINK" to "$ACTUAL_DIR"
ln -s "$ACTUAL_DIR" "$SYMLINK"
Create a symbolic link named "$tmpdir/bam" to the full path of command "bam2" found in "$PATH"
ln -s "$(which bam2)" "$tmpdir"/bam
Create a symbolic link named "${DESTINATION}${file}" to "${TARGET}${file}"
ln -s "${TARGET}${file}" "${DESTINATION}${file}"
create a symbolic link named "-pdf-kundendienst" to "local--pdf-kundendienst" file
ln -s -- ./local--pdf-kundendienst -pdf-kundendienst
Create a symbolic link named ".bash_profile" to ".bashrc"
ln -s .bashrc .bash_profile
Create a symbolic link named "/lib/libc.so.0" to "/lib/libc.so.6"
ln -s /lib/libc.so.6 /lib/libc.so.0
create a symbolic link named "/usr/bin/my-editor" to file "/usr/share/my-ditor/my-editor-executable"
ln -s /usr/share/my-ditor/my-editor-executable /usr/bin/my-editor
create a symbolic link named "/usr/lib/jvm/default-java" to file "/usr/lib/jvm/java-7-oracle"
sudo ln -s /usr/lib/jvm/java-7-oracle /usr/lib/jvm/default-java
Create a symbolic link named "temp" to "newtarget"
ln -s newtarget temp
Create a symbolic link named "wh" to "$wh"
ln -s "$wh" wh
create a symbolic link named "www" to file "www1"
ln -s www1 www
Create a symbolic link named "~/bin/subl" to "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Create a symbolic link relative to link location named "$dest_dir/$orig_name" to "$orig_dest"
ln -r -s "$orig_dest" "$dest_dir/$orig_name"
Create a symbolic link to "$file" named "/tmp/allfiles"
ln $file /tmp/allfiles
Create a symbolic link to file "/usr/bin/perl" named with escaped characters "/usr/local/bin/perl\r\n"
sudo ln -s /usr/bin/perl /usr/local/bin/perl`echo -e '\r'`
create a symbolic link with absolute path "/cygdrive/c/Users/Mic/mypics" to file "/cygdrive/c/Users/Mic/Desktop/PENDING - Pics/"
ln -sf '/cygdrive/c/Users/Mic/Desktop/PENDING - Pics/' /cygdrive/c/Users/Mic/mypics
Create a symbolic lnk named "$1/link" to "$dir"
ln -s "$dir" "$1/link"
Create a tar archive with all *.java files under the current directory
find . -type f -name "*.java" | xargs tar cvf myfile.tar
create a tar ball of all pdf files in current folder
find . -name *.pdf | xargs tar czvf /root/Desktop/evidence/pdf.tar
create a tar file of all the songs on my system that have been modified in the last 180 days (which is essentially six months)
find . -name -type f '*.mp3' -mtime -180 -print0 | xargs -0 tar rvf music.tar
create a tar of all png & jpg images in the current folder
find . \( -iname "*.png" -o -iname "*.jpg" \) -print -exec tar -rf images.tar {} \;
create a tar.gz compress file with all the jpg files in the entire file system
find / -name *.jpg -type f -print | xargs tar -cvzf images.tar.gz
Creae a tarball 'files.tar.gz' containing all regular files under current directory tree that are newer than 2013-12-04 and older than 2013-12-05
find . -type f -name "*" -newermt 2013-12-04 ! -newermt 2013-12-05 | xargs -I {} tar -czvf files.tar.gz {}
create a zip of all the files in the current folder which are bigger than 100Kb and do not go more than 2 levels during search
find . -maxdepth 2 -size +100000 -exec bzip2 {} \;
create a zip of log files in the current directory which have not been accessed in the last 3 days (-p is for parallel processing for a 4 cpu machine)
find . -name '*.log' -mtime +3 -print0 | xargs -0 -P 4 bzip2
create a zip of log files in the current directory which have not been accessed in the last 3 days (-p is for parallel processing for a 4 cpu machine, -n is for maximum work units)
find . -name '*.log' -mtime +3 -print0 | xargs -0 -n 500 -P 4 bzip2
Creates alias for network interface 'eth0' with IP address '192.0.2.55' and network mask '255.255.255.255'.
ifconfig eth0:fakenfs 192.0.2.55 netmask 255.255.255.255
Create all directories in the path specified by variable $javaUsrLib as super user
sudo mkdir -p $javaUsrLib
Create all directories in the path specified by variable $tempWork
mkdir -p $tempWork
create an archive excluding files matching patterns listed in /path/to/exclude.txt
tar -czf backup.tar.gz -X /path/to/exclude.txt /path/to/backup
create an archive using 7zhelper.sh as a compress program
tar -I 7zhelper.sh -cf OUTPUT_FILE.tar.7z paths_to_archive
create an archive using pbzip2 as a compress program
tar -I pbzip2 -cf OUTPUT_FILE.tar.bz2 /DIR_TO_ZIP/
create an archive using pbzip2 as a compress program
tar -I pbzip2 -cf OUTPUT_FILE.tar.bz2 paths_to_archive
Create an empty file "foo" in each directory under the current directory containing a file named "bar".
find -name "bar" -execdir touch foo \;
Create an empty file 'last.check' in directory pointed by variable "log_dir", with specified timestamp.
touch -m 201111301200.00 $log_dir/last.check
Create an empty file called "emptyfile.c"
cp /dev/null emptyfile.c
Create an empty file (or update timestamp of file) specified by variable "correctFilePathAndName"
touch "$correctFilePathAndName"
Create an empty file with a carriage return character in its name.
echo -e "Icon\\r" | xargs touch
Create an empty file with a carriage return character in its name.
touch $'Icon\r'
Create an empty index.html in each directory under the current one, updating timestamps of already existing index.html files.
find . -type d -exec touch {}/index.html \;
Create an empty index.html, or update its timestamp if it already exists.
touch index.html
create and list contents of the archive
tar cf - $PWD|tar tvf -
create archive "backup.tar.gz" from /path/to/catalog
tar czfP backup.tar.gz /path/to/catalog
Create compressed archive from "my_large_file_1" and "my_large_file_2" and split into files of size 1024 MiB with prefix "myfiles_split.tgz_"
tar cz my_large_file_1 my_large_file_2 | split -b 1024MiB - myfiles_split.tgz_
Create compressed archive of all the files in the current directory tree that have been modified in the last 7 days
find . -type f -mtime -7 -print -exec cat {} \; | tar cf - | gzip -9
create the compressed tar archive images.tar.gz containing all jpg files found under /
find / -name *.jpg -type f -print | xargs tar -cvzf images.tar.gz
create directory ".hiddendir"
mkdir .hiddendir
Create directories "/tmp/x/y/z/" on remote host before copying "$source" to "user@remote:/tmp/x/y/z/"
rsync -a --rsync-path="mkdir -p /tmp/x/y/z/ && rsync" $source user@remote:/tmp/x/y/z/
Create the directory '.npm-global' in the user's home directory(~).
mkdir ~/.npm-global
Create directorie(s) 'some/path' as required in the current directory
mkdir -p ./some/path
create directory /cpuset
mkdir /cpuset
create directory /data/db
sudo mkdir /data/db
create directory /etc/cron.minute
mkdir /etc/cron.minute
create directory /path/to/destination
mkdir /path/to/destination
create directory /tmp/new
mkdir /tmp/new
create directory /var/svn as user root
sudo mkdir /var/svn
create directories a b c d e
mkdir a b c d e
create directory aaa
mkdir aaa
create directory aaa/bbb
mkdir aaa/bbb
create directory backup
mkdir backup
create directories bravo_dir and alpha_dir
mkdir bravo_dir alpha_dir
create directory destdir
mkdir destdir
create directory dir
mkdir -p dir
create directory es if it is not exist and create direcoty LC_MESSAGES
mkdir -p es/LC_MESSAGES
create directory foo
mkdir -p foo
create directory foo
mkdir foo
create directory log into home directory
mkdir ~/log
create directory new_dir
mkdir new_dir
create directory practice into home directory
mkdir ~/practice
create directory public_html into home directory
mkdir ~/public_html
create directory saxon_docs
mkdir saxon_docs
create directory subdirectory
mkdir subdirectory
create directory temp into home directory
mkdir ~/temp
create directory testExpress
mkdir testExpress
create directory TestProject
mkdir TestProject
Create empty files (or update timestamps if they exist) with names matching each word in variable "correctFilePathAndName"
echo -e "$correctFilePathAndName" | xargs touch
Creates file by template 'aws-sync-XXXXX' in a current folder and stores file name in a 'dir' variable.
dir="$(mktemp aws-sync-XXXXX)"