<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Cheatsheet for Linux !!]]></title>
	<link>https://bioinformaticsonline.com/pages/view/27965/cheatsheet-for-linux?</link>
	<atom:link href="https://bioinformaticsonline.com/pages/view/27965/cheatsheet-for-linux?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/27965/cheatsheet-for-linux</guid>
	<pubDate>Wed, 22 Jun 2016 07:55:06 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/27965/cheatsheet-for-linux</link>
	<title><![CDATA[Cheatsheet for Linux !!]]></title>
	<description><![CDATA[<p>Linux Commands Cheat Sheet<br /><br />&nbsp;&nbsp;&nbsp; File System<br /><br />&nbsp;&nbsp;&nbsp; ls &mdash; list items in current directory<br /><br />&nbsp;&nbsp;&nbsp; ls -l &mdash; list items in current directory and show in long format to see perimissions, size, an modification date<br /><br />&nbsp;&nbsp;&nbsp; ls -a &mdash; list all items in current directory, including hidden files<br /><br />&nbsp;&nbsp;&nbsp; ls -F &mdash; list all items in current directory and show directories with a slash and executables with a star<br /><br />&nbsp;&nbsp;&nbsp; ls dir &mdash; list all items in directory dir<br /><br />&nbsp;&nbsp;&nbsp; cd dir &mdash; change directory to dir<br /><br />&nbsp;&nbsp;&nbsp; cd .. &mdash; go up one directory<br /><br />&nbsp;&nbsp;&nbsp; cd / &mdash; go to the root directory<br /><br />&nbsp;&nbsp;&nbsp; cd ~ &mdash; go to to your home directory<br /><br />&nbsp;&nbsp;&nbsp; cd - &mdash; go to the last directory you were just in<br /><br />&nbsp;&nbsp;&nbsp; pwd &mdash; show present working directory<br /><br />&nbsp;&nbsp;&nbsp; mkdir dir &mdash; make directory dir<br /><br />&nbsp;&nbsp;&nbsp; rm file &mdash; remove file<br /><br />&nbsp;&nbsp;&nbsp; rm -r dir &mdash; remove directory dir recursively<br /><br />&nbsp;&nbsp;&nbsp; cp file1 file2 &mdash; copy file1 to file2<br /><br />&nbsp;&nbsp;&nbsp; cp -r dir1 dir2 &mdash; copy directory dir1 to dir2 recursively<br /><br />&nbsp;&nbsp;&nbsp; mv file1 file2 &mdash; move (rename) file1 to file2<br /><br />&nbsp;&nbsp;&nbsp; ln -s file link &mdash; create symbolic link to file<br /><br />&nbsp;&nbsp;&nbsp; touch file &mdash; create or update file<br /><br />&nbsp;&nbsp;&nbsp; cat file &mdash; output the contents of file<br /><br />&nbsp;&nbsp;&nbsp; less file &mdash; view file with page navigation<br /><br />&nbsp;&nbsp;&nbsp; head file &mdash; output the first 10 lines of file<br /><br />&nbsp;&nbsp;&nbsp; tail file &mdash; output the last 10 lines of file<br /><br />&nbsp;&nbsp;&nbsp; tail -f file &mdash; output the contents of file as it grows, starting with the last 10 lines<br /><br />&nbsp;&nbsp;&nbsp; vim file &mdash; edit file<br /><br />&nbsp;&nbsp;&nbsp; alias name 'command' &mdash; create an alias for a command<br />&nbsp;&nbsp;&nbsp; System<br /><br />&nbsp;&nbsp;&nbsp; shutdown &mdash; shut down machine<br /><br />&nbsp;&nbsp;&nbsp; reboot &mdash; restart machine<br /><br />&nbsp;&nbsp;&nbsp; date &mdash; show the current date and time<br /><br />&nbsp;&nbsp;&nbsp; whoami &mdash; who you are logged in as<br /><br />&nbsp;&nbsp;&nbsp; finger user &mdash; display information about user<br /><br />&nbsp;&nbsp;&nbsp; man command &mdash; show the manual for command<br /><br />&nbsp;&nbsp;&nbsp; df &mdash; show disk usage<br /><br />&nbsp;&nbsp;&nbsp; du &mdash; show directory space usage<br /><br />&nbsp;&nbsp;&nbsp; free &mdash; show memory and swap usage<br /><br />&nbsp;&nbsp;&nbsp; whereis app &mdash; show possible locations of app<br /><br />&nbsp;&nbsp;&nbsp; which app &mdash; show which app will be run by default<br />&nbsp;&nbsp;&nbsp; Process Management<br /><br />&nbsp;&nbsp;&nbsp; ps &mdash; display your currently active processes<br /><br />&nbsp;&nbsp;&nbsp; top &mdash; display all running processes<br /><br />&nbsp;&nbsp;&nbsp; kill pid &mdash; kill process id pid<br /><br />&nbsp;&nbsp;&nbsp; kill -9 pid &mdash; force kill process id pid<br />&nbsp;&nbsp;&nbsp; Permissions<br /><br />&nbsp;&nbsp;&nbsp; ls -l &mdash; list items in current directory and show permissions<br /><br />&nbsp;&nbsp;&nbsp; chmod ugo file &mdash; change permissions of file to ugo - u is the user's permissions, g is the group's permissions, and o is everyone else's permissions. The values of u, g, and o can be any number between 0 and 7.<br /><br />&nbsp;&nbsp;&nbsp; 7 &mdash; full permissions<br /><br />&nbsp;&nbsp;&nbsp; 6 &mdash; read and write only<br /><br />&nbsp;&nbsp;&nbsp; 5 &mdash; read and execute only<br /><br />&nbsp;&nbsp;&nbsp; 4 &mdash; read only<br /><br />&nbsp;&nbsp;&nbsp; 3 &mdash; write and execute only<br /><br />&nbsp;&nbsp;&nbsp; 2 &mdash; write only<br /><br />&nbsp;&nbsp;&nbsp; 1 &mdash; execute only<br /><br />&nbsp;&nbsp;&nbsp; 0 &mdash; no permissions<br /><br />&nbsp;&nbsp;&nbsp; chmod 600 file &mdash; you can read and write - good for files<br /><br />&nbsp;&nbsp;&nbsp; chmod 700 file &mdash; you can read, write, and execute - good for scripts<br /><br />&nbsp;&nbsp;&nbsp; chmod 644 file &mdash; you can read and write, and everyone else can only read - good for web pages<br /><br />&nbsp;&nbsp;&nbsp; chmod 755 file &mdash; you can read, write, and execute, and everyone else can read and execute - good for programs that you want to share<br />&nbsp;&nbsp;&nbsp; Networking<br /><br />&nbsp;&nbsp;&nbsp; wget file &mdash; download a file<br /><br />&nbsp;&nbsp;&nbsp; curl file &mdash; download a file<br /><br />&nbsp;&nbsp;&nbsp; scp user@host:file dir &mdash; secure copy a file from remote server to the dir directory on your machine<br /><br />&nbsp;&nbsp;&nbsp; scp file user@host:dir &mdash; secure copy a file from your machine to the dir directory on a remote server<br /><br />&nbsp;&nbsp;&nbsp; scp -r user@host:dir dir &mdash; secure copy the directory dir from remote server to the directory dir on your machine<br /><br />&nbsp;&nbsp;&nbsp; ssh user@host &mdash; connect to host as user<br /><br />&nbsp;&nbsp;&nbsp; ssh -p port user@host &mdash; connect to host on port as user<br /><br />&nbsp;&nbsp;&nbsp; ssh-copy-id user@host &mdash; add your key to host for user to enable a keyed or passwordless login<br /><br />&nbsp;&nbsp;&nbsp; ping host &mdash; ping host and output results<br /><br />&nbsp;&nbsp;&nbsp; whois domain &mdash; get information for domain<br /><br />&nbsp;&nbsp;&nbsp; dig domain &mdash; get DNS information for domain<br /><br />&nbsp;&nbsp;&nbsp; dig -x host &mdash; reverse lookup host<br /><br />&nbsp;&nbsp;&nbsp; lsof -i tcp:1337 &mdash; list all processes running on port 1337<br />&nbsp;&nbsp;&nbsp; Searching<br /><br />&nbsp;&nbsp;&nbsp; grep pattern files &mdash; search for pattern in files<br /><br />&nbsp;&nbsp;&nbsp; grep -r pattern dir &mdash; search recursively for pattern in dir<br /><br />&nbsp;&nbsp;&nbsp; grep -rn pattern dir &mdash; search recursively for pattern in dir and show the line number found<br /><br />&nbsp;&nbsp;&nbsp; grep -r pattern dir --include='*.ext &mdash; search recursively for pattern in dir and only search in files with .ext extension<br /><br />&nbsp;&nbsp;&nbsp; command | grep pattern &mdash; search for pattern in the output of command<br /><br />&nbsp;&nbsp;&nbsp; find file &mdash; find all instances of file in real system<br /><br />&nbsp;&nbsp;&nbsp; locate file &mdash; find all instances of file using indexed database built from the updatedb command. Much faster than find<br /><br />&nbsp;&nbsp;&nbsp; sed -i 's/day/night/g' file &mdash; find all occurrences of day in a file and replace them with night - s means substitude and g means global - sed also supports regular expressions<br />&nbsp;&nbsp;&nbsp; Compression<br /><br />&nbsp;&nbsp;&nbsp; tar cf file.tar files &mdash; create a tar named file.tar containing files<br /><br />&nbsp;&nbsp;&nbsp; tar xf file.tar &mdash; extract the files from file.tar<br /><br />&nbsp;&nbsp;&nbsp; tar czf file.tar.gz files &mdash; create a tar with Gzip compression<br /><br />&nbsp;&nbsp;&nbsp; tar xzf file.tar.gz &mdash; extract a tar using Gzip<br /><br />&nbsp;&nbsp;&nbsp; gzip file &mdash; compresses file and renames it to file.gz<br /><br />&nbsp;&nbsp;&nbsp; gzip -d file.gz &mdash; decompresses file.gz back to file<br />&nbsp;&nbsp;&nbsp; Shortcuts<br /><br />&nbsp;&nbsp;&nbsp; ctrl+a &mdash; move cursor to beginning of line<br /><br />&nbsp;&nbsp;&nbsp; ctrl+f &mdash; move cursor to end of line<br /><br />&nbsp;&nbsp;&nbsp; alt+f &mdash; move cursor forward 1 word<br /><br />&nbsp;&nbsp;&nbsp; alt+b &mdash; move cursor backward 1 word</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>