Showing posts with label Computer Tips. Show all posts
Showing posts with label Computer Tips. Show all posts

Wednesday, February 12, 2014

15 Popular Linux Commands with Examples

No comments:


In this tuturial i will present you my absolute top 15 linux commands.

As an addition to the wonderfull tutorial of Justin http://community.linuxmint.com/tutorial/view/100

will this tutorial introduce totally new command's. The reason: Because knowing these commands will make your life a whole lot easier!

I am also showing examples on how to use the command as well.

Let's get started!

-------------------------------------------------------------------------------------------------------------------------------------------------

# 1: cd

The "Change Directory" command enables you to navigate to another directory.

The cd command is THE most important command there is in linux i think. As the command suggests, it enables the user to change / jump to a directory.

Example: cd Downloads
Example: cd /etc/
Example: cd .. (Directory up!)


note: Afther you have typed cd and entering the first or two letters of the directory you can press the TAB key to autocomplete the directory! so... cd  Do (press tabkey) will autocomplete it to Downloads. i use this a lot <-- p="">
#2: man

The man command shows the users the "manual" of the command. In some situation you might need to get more information about the command you are using. The man command shows you this information about the command.

Example: man cp

This will open up the "cp" manual document for us in the shell. The manual shows us the parameters available for the commands.

note: To close the manual simply press "Q".



#3: ls

In the absolute top 15 there's no way the ls command is missing. On the third place, the ls command. The ls command is used to list the files/directories within a directory.

Example: ls

It shows us the directories available.



#4: cp

The cp command is available for us to "Copy" things. This might be usefull for duplicating files f.e.

Example: cp file file2

note: file is on this case the file the user wants to be copied... file2 is the name of the copied file. It's that simple.



#5 mv

The mv command is used for "Move" operations. The mv commands enables the users to move a file/directory to a specified location.

Example: mv /home/bas/Desktop/bla /home/bas/Desktop/fiets


note: the first part of the command is the file that has to be moved. The second part (after the whitespace) is the target directory. Make sure you type in the full path using this command!



#6 mkdir

This command is used to "make" directories, NOT Files.. (thit is possible with another command which i will bring up later in this tutorial)

Example: mkdir testdirectory

note: The name of the directory is case sensitive which means that Testdirectory is a complete different directory as testdirectory.



#7 rmdir

When you are able to make directories, you also want to know how to remove them. Removing directories is done by the rmdir command and belongs to the absolute basic commands in shell bashing.

Example: rmdir fiets

note: When the directory is not empty the command will prompt an error message:

rmdir: failed to remove `fiets': Directory not empty


So make sure it's completely empty before removing it.



#8 touch

Now we know how to make directories and deleting them, i now want to use the touch command. The touch command is used to make files.

Example: touch vogel

This will create the file vogel for us in the directory.



#9 rm

The rm command stand for remove. The rm command is used in order the delete files instead of directories.

Example: rm vogel

note: To remove files you must have the right permission bits set on the specific file.



#10 tar

Sometimes you have to archive files. Archiving files is a way to pack a set of files to one single file. The operation is done by the tar command.

Example: tar -cvf test.tar test (Creating a tar file from directory or file test)

Example: tar -xvf test.tar myexctractfolder (Extracts the particular tar file in the current working directory)

In the example i used parameters. These parameters are telling the tar command how to behave and how to execute.  After the parameters i entered the name of the file which is test.tar. The second part is the source directory/file of the tar file. In this situation a directory called test.



#11 pwd

Sometimes you really wonder where you are in the system. PWD is the solution for that problem.

PWD stands for Path Working Directory.

Example: pwd



#12 ifconfig

ifconfig is a command showing you information about the ethernet adapters on your system. It contains very usefull information like gateway, ip,  and packet statistics. For the average user this command is rarely used, but i think it's worth knowing it.

Example: ifconfig

note: To gain information about the wireless adapters on your system type iwconfig.



#13 locate

Locate is an extremely fast seaching command. It shows the directories or files each on a new line.

Example: locate syslog

Example: locate syslog | more (Piping structure used to invert the data from locate to the more command)

note: Some keywords returns enormous ammounts of hits. Use MORE to  (see example)  clear things up a bit.



#14 ping

Ping is used as a network diagnostic command by professionals. Ping offers information about the network we are on and if the other system responds to us. In cases of troubleshooting network related problems, ping can do a great job to determine the domain of the problem.

Example: ping www.google.com

The command returns the interval and % of loss during the test.

note: You can stop ping bij pressing crtl-c at the same time.



#15 chmod

The chmod command. The chmod command comes from "Change Mode" back to the unix times. It's a great command to restrict access to directories or files. But before i show you an example on how to use it, some theory.

Chmod is qiet an advanced command to use. So therefore you really need to understand how it works.
chmod works with so called persmission bits. These bits can be set to a certain level of restrictions.

We have the following bits available:

7 full
6 read and write
5 read and execute
4 read only
3 write and execute
2 write only
1 execute only
0 none
source: http://en.wikipedia.org/wiki/Chmod



The bits shown above are the permissions for a particular group or class.

Files or directories contain four classes:

1st: The owner itself
2nd: Member of the file group
3rd: Others
4th: All of the above

To set the right permission bits the a particular group or class it is very important to select to right amount of permission bits.

for example, i will create a file and protect this file for being modified by anyone else besides me. Also will i protect the file for being deleted.

This is how i do it: chmod 400 mijndagboek

In this command i gave up the 4 bit in the "members of the group" 0 to others and 0 to all.

Now not even me is able to delete the file anymore without using the sudo command.

But.. there is more. The classes i talked about earlier are devided into three seperate like actions.. those are:

Read
Write
Execute
In order to add very specific restrictions to a file or folder you can use a trick to do that. I will show you how.

If we want to restrict access to a file without knowing the exact bit number we can do the following.

RWX = 7 Which is the permission bit of Read, Write, and Execture together.

Seperating these bits gives us the following values individually:

Read = 4 bits.
Write = 2 bits.
Exec = 1 bit.


So we have 3 groups to take care of (the first group which is the owner is optional in chmod)

[membersgroupbit],[others],[alloftheabove]

if we want to give everyone, and i mean everyone access to the directory i can do:

chmod 777 mijndagboek

[read=4+Write=2+Execute=1=7],[read=4+Write=2+Execute=1=7],[read=4+Write=2+Execute=1=7]

This is not good!

We want to restrict the access for the file offcourse so a better chmod would be:

chmod 700

[read=4+Write=2+Execute=1],[0][0]



--------------------------------------------------------------------------------------------------------------------

This is the end of the top 15 i made for you. I hope you enjoyed it, and hopefully even learned something as well.

i wish you all good luck mastering linux.


Gsv Pics |Gsv Vids | Techno zip| Divine Thought | For The Sake of Us | Gsv Films |Admin YouTube Videos

Saturday, December 28, 2013

Safe Gaurd your PC - BEST Security Tips

No comments:




Happy New Year to all my readers! I wish you the best of health and happiness in 2014.

With that said, I need to remind everyone to be alert during the New Year’s Eve celebrations for people who fire guns into the air. The minute you hear gunshots, please call police immediately.

This past week, I received emails from several seniors and parents who just got their first computer and shared many concerns. The computer is a wonderful invention but it can also bring nightmares. I pulled some information from one of our crime prevention partners, The National Crime Prevention Council, and here are tips you need to take seriously whether you are a senior or a parent:

• Use anti-virus software and keep it up-to-date. The software is designed to protect your computer against known viruses but, with new viruses emerging daily, anti-virus programs need regular updates.

• Don’t open emails or attachments from unknown sources. Be suspicious of any unexpected email attachments even if they appear to be from someone you know. Should you receive a suspicious email, the best thing to do is to delete the entire message, including any attachment.

• Protect your computer from Internet intruders by using firewalls. These create a protective wall between your computer and the outside world. They come in two forms, software firewalls that run on your personal computer and hardware firewalls that protect a number of computers at the same time. Firewalls also ensure that unauthorized persons can’t gain access to your computer while you’re connected to the Internet.

• Use hard-to-guess passwords. Mix uppercase and lowercase letters, numbers and other characters, and make sure your passwords are at least eight characters long. Don’t share your password and don’t use the same password in more than one place. Don’t use your maiden name or the names of your mother, your children or your spouse’s family. Those are easy to figure out.

• Disconnect your computer from the Internet when not in use. This lessens the chance that someone will be able to access your computer. Also, if you haven’t kept your anti-virus software up to date or don’t have a firewall in place, someone could infect your computer.

• Check your security on a regular basis. You should evaluate your computer security at least twice a year. Do it when you change the clocks for daylight savings, just as when you check the batteries in your smoke alarm.

• Back up your computer data on disks or CDs regularly. I use a thumb drive. If we have a hurricane, I can take it with me. There is nothing worst than losing pictures, information and work when a computer crashes. It happened to me, and you will want to cry, which I did.

Last I want to remind all parents that if you gave a computer to your child, no matter what age, please make sure that the computer is somewhere you can see it. For more information on internet safety, visit www.ncpc.org or email me and I will send you some brochures.


Disclaimer | Home | Gsv Films Gsv Pics | Gsv Vids | Techno zip |  Divine-Thought

Recent Posts