ls is used to get a list of files/folders in the current directory:
ls -l gives a vertical list with a lot of information(not covered here)
if you want to get a list from another directory, pass the path after the command, like:
ls -l /usr/bin
if you want to see hidden files too, simply add -a like: ls -l -a or ls -la,hidden files/folders
are those with a dot prefix:
for all the options read the manual with man ls.
pwd says the folder where you are:
more info with man pwd.
cd is used to get inside/outside of a folder like: cd /home/user/Desktop, if you want to step back
of one to go to the /home/user folder simply type cd .., for more commands type man cd.
cp is used to copy files (folders with -r) from a folder to another:
cp /home/user/Desktop/file1.txt /home/user/Documents copies one file only
you can copy an entire folder with cp -r /home/user/Desktop/mp3 /home/user/Music, now
you have a the folder mp3 inside the folder Documents
if you want the content of the mp3 folder inside the Music folder use
cp /home/user/Desktop/mp3/* /home/user/Music. ls -l shows the content:
more options on the manual man cp.
mv move (used for rename too) files/folders, mv file1 file2 renames file1 to file2 mv file1 /home/user/Documents moves the file from current folder to Documents folder.
Type man mv for more options.
free check the RAM / swap usage, free -om displays values in megabytes:
more info with man free.
df displays disks usage, df -h displays auto Kilo/Mega/Gigasuddivision:
check man df for more info.
touch creates a file, touch myfile creates a file named myfile in the working derectory.
more option in the manual man touch.
mkdir creates a folder, mkdir newfolder creates a folder named newfolder in the actual directory.
more option in the manual man mkdir.
chmod changes the permissions in witch users interact with a file, for example you are the owner of the file and you have read and write permission, standard users shouldn’t write and execute that file.
You can pass 3 paramaters (numbers) which are combined values of:
so you execute chmod 744 myfile which means4+2+1(7) for the owner, 4 for the usergroup, 4 for the world.
When you execute ls -l the left part of the info gives you the explanation of what is going on
-rwxr--r-- 1 embedded users 0 Dec 6 00:04 myfile
- means file (folder would be d) rwx is read/write/execute for the owner, r-- read only for the usergroup, r-- read only for the world, date and time of ‘last modified’ and filename.
chmod --help and man chmod give you more info.
date prints date and time, date --help and man date for more info.
cal prints the calendar.