This blog is for the person who are all new to GNU/Linux based operating and not only for them I will explain some magical powerful code which normal GNU/Linux based OS
After Installation of GNU/Linux based Operating System(OS) I don’t know how to operate the system? how to access the application?
Now got the answer? If you know how to use console then you will automatically a friend of OS.
I know all can have the same Peelings(feelings) so here after don’t worry :p I’m gonna teach you how to make your GNU/Linux OS as your friend.How it is possible to have friendship with OS? yes there is an application program called Linux console(Terminal) which allow you to speak with OS(useful for input and output operation) and to make your kernel as friend.
Using shell commands. yes it pretty simple You just open your console and enter shell commands
Shell is the program that takes command from the keyboard and interact with kernel
here is How we normally do?
I’m gonna explain some of the shell command to talk with your OS
Lets type something in console Devux
and hit enter
it show command not found. yes have some default commands to execute in terminal we can’t any string but don’t question me only we can able to create default one? we cannot create new one like that???
yeah, we can create a new command that we will see later
#Basic commands
ls
list files inside the directory
some more feature:
ls -a
display the list of file with hidden files
ls -l
display the list of file with r/w permission and timing details
mkdir
create new directory
syntax: mkdir <directory_name>
example: mkdir fsftn
#Open and Close Folder(Directory)
cd
open&close-directory
syntax: cd <directory_name>
example: cd fsftn
rm
remove files
syntax: rm <file_name>
example: rm sample.txt
rm -r
remove folder
syntax: rm <folder_name>
example:rm -r fsftn
cp
copy filec
syntax: cp <source_file_location> <destination_file_location>
example: cp /fsftn/sample.txt /Downlaods
you can refer the image for simple example i have done created,copied and deleted directory,files etc
ls /etc /bin
list the file in both etc and bin directory
by using the above command you can see filename,modification time at last,size of file,group and owner of file and file permissions
syntax: type <command-name>
example: type ls
syntax: file <file name>
example: file fsftn.txt
There is no work of mouse in you console you can easily handle by using only keyboard.only thing
Hierarchical file system.All the directory comes under the root directory(/)
we can have more then one user but only one super user
Normal user can able to create delete,update only in particular directory Super user can have all right in whole OS.To work as a super user you just type
su or sudo su
hit -> enter give your password
Now you can able to access all the file in your file system.
you can learn file permission here
for more details you can visit
Let me complete this blog with functions
you can also define functions in console itself.
Syntax:
function_name()
{
<commands>
<shell script>
<etc>
}
example:
details()
{
date
ls
ls -a
}
and then type details and hit enter you will see that three commands executed at same time one by one in the order which we gave in details() function.
And this is specially dedicated to rocking echo "village boys"
.