Skip to content

BrianCrosser/notes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Notes

Entry Template

command - Description

Examples:

bash code in here

File Management

mv - Move file or Rename file

Examples:

mv sourceFile destinationFile
mv sourceFile destinationLocation
mv myFile.txt myFolder/

cp - Copy file or folder

Examples:

cp filename.cpp myCopy.cpp
cp -r myFolder/ myNewFolder

  • cp (folder and individual files)

rm - remove files or directories

Examples:

rm filename.cpp
rm myFolder

rmdir - remove empty directories

Examples:

rmdir myFolder

ln -s - ln: make links between files. -s: make symbolic links instead of hard links.

Example:

ln -s filenameMain.cpp fiilenameSupport.cpp

scp - secure copy

Example:

scp filename.cpp myCopy.cpp

pwd - print name of current/working directory

Example:

pwd (screen displays: USER/myFolder/subFolder)

ls - ls: list directory contents. ls -a: list all directory contents(including hidden files).

Examples:

ls (screen displays: filename1.cpp filename2.txt filename3.cpp README.md filename5.txt)
ls *.txt (screen displays: filename2.txt filename5.txt)
ls -s (screen displays: filename1.cpp filename1.cpp~ filename2.txt filename3.cpp filename3.cpp~ README.md filename5.txt)

tar - creates an archive of given folders

Examples:

tar cfvz archiveFolder.tgz folderBeingArchived folderBeingArchived2

File Transfer

curl - transfer a URL

Example:

curl http://webAddressGoesHere.com
curl -o http://webAddressGoesHere.com

wget - non-interactive netowrk downloader

Example:

wget http://webAddressGoesHere.com

rsync - a fast, versatile, remote(and local) file-copying tool

Example:

rsync filename.cpp copyFile.cpp

Pipe tools

cat - prints out the contents of a file

Example:

cat filename.cpp
less filename.cpp

sort - sorts lines of text files

Example:

sort filename.cpp
less filename.cpp | sort

uniq - reports repeated lines

Example:

uniq filename.cpp
less filename.cpp | uniq
less filename.cpp | uniq -c

grep - a way of searching for a character or word

Example:

grep *.txt
grep "character" filename.cpp

About

Examples and notes for commonly used commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors