Last active
February 17, 2016 13:56
-
-
Save wisecrab/858ac7bf00890d948cf6 to your computer and use it in GitHub Desktop.
A collection of useful terminal commands to use in linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Check if packages are installed | |
dpkg --get-selections | grep [package_name] | |
//Show a list of files and directories in the current directory. | |
ls | |
//Show file permissions | |
ls -l /avr/www/html/index.php | |
//Edit a file | |
nano /var/www/html/file-name.php | |
/******************************** | |
*** Directories *** | |
********************************/ | |
//Copy a file | |
cp file-name copied-file-name | |
Copy a directory | |
cp -r folder copied-folder | |
//Move or rename a file | |
mv: The mv command will move a file to a different location or will rename a file. Examples are as follows: "mv file foo" will rename the file "file" to "foo". "mv foo ~/Desktop" will move the file "foo" to your Desktop directory, but it will not rename it. | |
//Delete a file | |
rm file.txt | |
//Delete an empty directory | |
rmdir folder-name | |
Delete directory and all files/folders in it | |
rmdir -r folder-name | |
//Create new directory | |
mkdir directory-name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment