Linux Command - Practice



the best way to use the command line is as you have said just by "practicing" it.
But there are a few usually to start with :

pwd ;- this should output something like

bash-5.0$ pwd
/home/andrew

because when you are in $ mode (i.e as a normal user) it opens up on the basis that it is located
in your home directory

What do i mean by "it" ?lets find out

ps $$
will output some like :
PID TTY STAT TIME COMMAND
6496 pts/1 Ss 0:00 bash

oh i see "it" means bash ,but which bash ?

$ bash --version

go to your desktop:

$ cmd Desktop
note the capital letter start of "Desktop"

list whats there:

ls --color
 
Last edited:
Literally, the best way to learn to use the terminal is to use it.

Start off by getting used to moving around the filesystem using cd. Get used to using absolute paths e.g.
cd /home/you/Documents/

relative paths:
cd ../Videos

Also ~ is a special shortcut to your home directory e.g.
/home/you/

So
cd ~/Documents
is a quicker way of getting to
/home/you/Documents
because you're typing less characters!


Get used to listing the contents of directories using the ls command.

Take a look at the man pages for ls and look at the different options you can use with ls, in order to see different information.

Then perhaps look at creating new directories using mkdir.

If you have some old files that you want to delete, take a very careful look at the rm command.

If you have some old, empty directories to remove- take a look at the rmdir command.

If you want to find files or directories in the terminal - take a look at the find and locate commands.

Start with those basic commands and then gradually expand your knowledge.
And remember - the man pages and info pages are your friends.

A lot of the programs in the terminal do very specific things. Some commands have a lot of different options that you can use to change their behaviors. And some of them only have very limited usefulness on their own. But when you start combining multiple commands using pipes - you will realise how powerful and flexible the terminal is.

The more you use the terminal, the more commands you will discover for different things. Eventually, you might want to take a look at writing scripts to automate things - and then you'll have another world of terminal based tools and tricks to learn.

And the good news is - the learning never stops! Even a seasoned terminal-junkie like myself is constantly learning new commands, new tricks and shortcuts. Etc.
 
hello someone has a file or a lab to practice find grep command ?
or a file in etc that contain a lot of information to grep on and find ...
kind regards
 
 
Hello guys,
I'm a linuxien beginner and i wanna pratice those cmd - https://linux.org/forums/linux-beginner-tutorials.123/
someone has exercices when i can practice ?
Thx in advance
My friend i have some great resources for you:


on this website paul cobbaut has written 6 excellent free books which teach linux using practical exercises. These books are not designed to be read but rather placed next to you computer while you tap in the commands and learn them. There are 6 books, be sure to begin with the linux fundamentals book then next would come the system administration commands book

At the end of each chapter are practical exercises to do ( he also gives the solutions to them in case you get stuck. Here is a sample at the end of the chapter on working with directories in the linux fundamentals workbook:


8.8. practice: working with directories
1. Display your current directory.
2. Change to the /etc directory.
3. Now change to your home directory using only three key presses.
4. Change to the /boot/grub directory using only eleven key presses.
5. Go to the parent directory of the current directory.
6. Go to the root directory.
7. List the contents of the root directory.
8. List a long listing of the root directory.
9. Stay where you are, and list the contents of /etc.
10. Stay where you are, and list the contents of /bin and /sbin.
11. Stay where you are, and list the contents of ~.
12. List all the files (including hidden files) in your home directory.
13. List the files in /boot in a human readable format.
14. Create a directory testdir in your home directory.
15. Change to the /etc directory, stay here and create a directory newdir in your homedirectory.
16. Create in one command the directories ~/dir1/dir2/dir3 (dir3 is a subdirectory from dir2,and dir2 is a subdirectory from dir1 ).
17. Remove the directory testdir.18. If time permits (or if you are waiting for other students to finish this practice), use andunderstand pushd and popd.


working with directories828.9. solution:
working with directories
1. .pwd
2. cd /etc
3. cd (and the enter key)
4. cd /boot/grub (use the tab key)
5. cd .. (with space between cd and ..)
6. cd /
7. ls
8. ls -l
9. ls /etc
10. ls /bin /sbin
11. .ls ~
12. ls -al ~
13. ls -lh /boot
14. mkdir ~/testdir
15. mkdir ~/newdir
16. mkdir -p ~/dir1/dir2/dir3
17. rmdir testdir



just work your way through the fundamentals book and my advise is if you come across bash scripting chapters just skip those , you can go back to scripting at a later date just smash your way through the main commands in the fundamentals book.

This is one of the best resources i have found on practicing linux commands. If you work your way through those books you will become a linux ninja!

hope this helps
 
Last edited:
Thx a lot guys

hey maelamrani i have another good one for you which will come in handy since your running Kali

use commands

hciconfig (this is for bluetooth interfaces)

iwconfig (this is for wireless adapters)

ifconfig ( for network interfaces/ cards)

if your running Kali you shoukd have bluetooth tools installed called "blueZ"

if you run command

hcitool scan

your computer should scan for nearby available bluetooth devices!

have fun!!!!
 

Members online


Top