User Tools

Site Tools


keller_and_evans_lab:unix_basics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
keller_and_evans_lab:unix_basics [2016/03/08 21:17]
scott Created page with "==Basics== moves or renames files mv file destination copies files cp file destination lists files in directory ls ls -ltrah..."
keller_and_evans_lab:unix_basics [2019/10/28 18:20] (current)
lessem ↷ Page moved from unix_basics to keller_and_evans_lab:unix_basics
Line 184: Line 184:
 A directory A directory
   tar -cvzf tar.file.name.tar directory   tar -cvzf tar.file.name.tar directory
-__Extract a tar'directory__\\+Extract a tar'directory
   tar -xvf tar.file.name.tar   tar -xvf tar.file.name.tar
-\\ + 
-__Extract a tar.gz directory__\\+Extract a tar.gz directory
   tar -zxvf tar.file.name.tar.gz   tar -zxvf tar.file.name.tar.gz
-    \\ + 
-__Extract MULTIPLE tar.gz directories__\\+Extract MULTIPLE tar.gz directories
   for i in *.tar.gz; do tar -zxvf "$i"; done   for i in *.tar.gz; do tar -zxvf "$i"; done
-\\    + 
-\\ + 
-\\ +====== Running multiple jobs at once in a shell script ====== 
-      Running multiple jobs at once in a shell script**\\ + 
-  ./S800-loop1.sh & + 
-    ./S800-loop2.sh & +   ./S800-loop1.sh & 
-    ./S800-loop3.sh & +   ./S800-loop2.sh & 
-\\ +   ./S800-loop3.sh & 
-\\ + 
-\\ + 
-      Pausing for a given amount of time between starting processes in a shell script**\\ + 
-  ./S800-loop1.sh & +====== Pausing for a given amount of time between starting processes in a shell script ====== 
-    sleep 45m + 
-    ./S800-loop2.sh & + 
-    sleep 45m +   ./S800-loop1.sh & 
-    ./S800-loop3.sh & +   sleep 45m 
-    sleep 45m +   ./S800-loop2.sh & 
-\\ +   sleep 45m 
-\\ +   ./S800-loop3.sh & 
-\\ +   sleep 45m 
-      Look at all files that have changed in last xx days** \\+ 
 + 
 + 
 +====== Look at all files that have changed in last xx days ====== 
   find /directory -type f -ctime -xx | more    find /directory -type f -ctime -xx | more 
-\\ + 
-\\ + 
-\\ +====== Look at multiple files at same time ====== 
-  *     Look at multiple files at same time** \\+
   less file1 file2 file3    less file1 file2 file3 
     :n forward to next file      :n forward to next file 
     :p backward to previous file      :p backward to previous file 
-\\ + 
-\\ + 
-\\ +====== Refresh .bashrc or .bash_profile files ====== 
-  *     Refresh .bashrc or .bash_profile files** \\ + 
-After you have modified one of the files above, you need to refresh your OS so it uses the correct .bashrc or .bash_profile settings. You can either restart the computer, logout and log back in, or do this: \\+After you have modified one of the files above, you need to refresh your OS so it uses the correct .bashrc or .bash_profile settings. You can either restart the computer, logout and log back in, or do this:
   source ~/.bash_profile #assuming that you've modified .bash_profile    source ~/.bash_profile #assuming that you've modified .bash_profile 
-\\ + 
-\\ + 
-\\ +====== Download files using command line ====== 
-  *     Download files using command line** \\+
   lwp-download http://pngu.mgh.harvard.edu/~purcell/plink/dist/plink-1.07-x86_64.zip    lwp-download http://pngu.mgh.harvard.edu/~purcell/plink/dist/plink-1.07-x86_64.zip 
 OR OR
   wget http://pngu.mgh.harvard.edu/~purcell/plink/dist/plink-1.07-x86_64.zip       wget http://pngu.mgh.harvard.edu/~purcell/plink/dist/plink-1.07-x86_64.zip    
-\\ + 
-\\ + 
-\\ +====== Copy (or move) files that have changed within the last 5 days ====== 
-  *     Copy (or move) files that have changed within the last 5 days** \\+
   find ./ -mtime -5 -exec cp {} ~new/path/folder \;   find ./ -mtime -5 -exec cp {} ~new/path/folder \;
 Make sure that the target folder isn't in the folder being found; i.e., that ~/new/path/folder isn't in ./. Otherwise, you'll start trying to copy the contents of the folder itself back into the folder.  Make sure that the target folder isn't in the folder being found; i.e., that ~/new/path/folder isn't in ./. Otherwise, you'll start trying to copy the contents of the folder itself back into the folder. 
-\\ + 
-\\ + 
-\\ +====== Get basic information about the computer or node that you are on ====== 
-  *     Get basic information about the computer or node that you are on** \\+
   cat /proc/cpuinfo    cat /proc/cpuinfo 
     cat /proc/cpuinfo | grep processor     cat /proc/cpuinfo | grep processor
-    cat /proc/cpuinfo | grep processor | wc +   cat /proc/cpuinfo | grep processor | wc
-\\ +
-\\ +
-\\ +
keller_and_evans_lab/unix_basics.1457497050.txt.gz · Last modified: 2016/03/08 21:17 by scott