Linux Tech Hacks

Your Linux tech hacks and Tips

Here's A List Of 83 Linux Commands For Beginners!



Here's A List Of 83 Linux Commands For Beginners!

Switching to Linux was a wonderful decision, now it's time to explore its power - the command line!

So
you have just switched to Linux and trying to figure out what was the
fuss about the command prompt as the most powerful tool. Well here's a
list of Linux commands for a beginner to help you get a glimpse of what
the command prompt can do for you.


Viewing,
copying, moving and deleting files


ls Display the contents of the current directory
ls -a Display also hidden files and hidden directories
   
cp filename /path/dir_name Copy filename into directory /path/dir_name
cp -r dir_name /path/dir_name2 Copy the entire dir_name into /path/dir_name2
cp filename1 filename2 /path/dir_name Copy filename1 and filename2 into /path/dir_name
   
rm name Remove a file or directory called name
rm -r name Remove an entire directory as well as its included files and subdirectories
   
mv filename /path/dir_name Move filename into /path/dir_name
mv filename1 filename2 Rename filename1 to filename2
   
cat filename Display filenames contents
   
more filename Display filename in pages. Use spacebar to view next page
   
head filename Display filenames first 10 lines
head -15 filename Display filenames first 15 lines
   
tail filename Display filenames last 10 lines
tail -15 filename Display filenames last 15 lines
   
pwd Display current directory
   
cd /path/dir_name Change to directory /path/dir_name
cd .. Go 1 directory up
   
mkdir dir_name Create directory dir_name
rmdir dir_name Delete directory dir_name


 


Finding
files and text within files


updatedb Update (create first time used) a database of all files under the root directory /
locate filename Find file filename searching in the database
   
find / -name filename Starting from the root directory search for the file called filename
find / -name *filename Same as above but search for file containing the string filename
   
grep string /path/dir_name Starting from /path/dir_name search for all files containing string
   
which application_name Search $path for application app_name
whereis application_name Search $path, man pages and source files for application_name


 


Archived
files


Decompress



tar -xzf filename.tgz Decompress tzg file
tar -xzf filename.tar.gz Decompress tar.gz file
tar -xjf filename.tar.bz2 Decompress tar.bz2 file


 

Compress

tar -czf filename.tar /path/dir_name Compress directory /path/dir_name to filename.tar
gzip -c filename > filename.gz Compress /path/dir_name to filename.tar.gz
bzip2 -c filename > filename.bz2 Compress /path/dir_name to filename.tar.bz2


 

Using rpm files 


rpm -hiv package.rpm Install rpm called package.rpm
rpm -hiv --force package.rpm Install rpm called package.rpm by force
rpm -hUv package.rpm Upgrade rpm called package.rpm
rpm -e package.rpm Delete rpm called package.rpm
rpm -qpil package.rpm List files in not-installed rpm called package.rpm
rpm -ql package.rpm List files in installed rpm called package.rpm
rpm -q str List installed rpms containing the string str
rpm -qf /path/application_name Display the rpm that contains application application_name


 

Starting and Stoping 


startx Start the X system
shutdown -h now Shutdown the system now and do not reboot


halt
Same as above
shutdown -r now Reboot
reboot Same as above
shutdown -r +10 Reboot in 10 minutes


 
 

Mounting filesystems


mount -t vfat /dev/sd(a)(1) /mnt/c_drive Mount the first partition 1 of the first hard disk drive a which is in fat32 vfat dormat under /mnt/c_drive directory
mount -t iso9660 /dev/cdrom /mnt/cdrom Mount cdrom under /mnt/cdrom directory
   
umount /mnt/hda1 Unmout the above


 


User
administration


users Display users currently logged in
adduser username Create a new user called username
passwd username Define password for user called username
who List logged-in users
whoami Display current user
finger username Displays info about user username
su Log in as root from current login
su - Log in as root from current login and take root's path
exit Exit from console login (ie, logout).


 

Processes 


command Execute command in the foreground
command & Execute command in the background
ctrl+z Suspend a program
ctrl+c Interrupt a program
ps List all processes
kill -9 pid Kill process with id pid
top Monitor processes in real time


 


Networking 


hostname List the system's hostname
ifconfig Set/Display network information
host ip Resolves ip's hostname
ping ip/hostname Check if ip/hostname is reachable
traceroute ip/hostname Find network path to ip/hostname


 
 

System Information


uname -a General system information
fdisk -l List partition tables
cp filename /path/dir_name Copy filename into directory /path/dir_name
df -T -h List filesystem disk space usage
lspci List PCI devices
lsusb List USB devices
free -m Display RAM+Swap usage


 

Program Compile




gcc -o output file.c Compile a C program
./output Run a C program you have compiled
g++ -o output file.cpp Compile a C++ program
./output Run a C++ program you have compiled
./configure && make && su -c 'make install' Configure, compile and install a program with Makefile

List Courtesy: my-guides








 


 




Fonte: Here's A List Of 83 Linux Commands For Beginners!

A Guide To Buying A Linux Laptop

Wednesday, August 21, 2013 There are some key points that users must take care of when buying a Linux powered laptop. In order to avoid hardware compatibility issues, selecting the right specifications for your laptop is very important. We present to you a quick check-list that you can refer to while buying your first Linux laptop.

What is your usage?

The very first task to do is to figure out how much you can spend on the laptop. Then figure out how big a laptop you want, in terms of screen size. You also need to know what exactly you are going to use the laptop for. For example, are you going to just surf on the internet and email or are do you need it for sysadmin purposes or playing games. You also need to figure out the battery backup of the laptop before buying. For gaming, you need a high-end laptop and even a dual booting system, since Linux is not very good at running gams.

The CPU

The Central Processing unit can be of many kinds in Linux. It supports all many different kinds of units. Some of the better known CPUs that Linux supports include the Intel Atom, Intern Core 2 Duo, Intel Core 7, AMD Ahtlon 64 mobile etc.

X Server and the Video Card

When choosing the Video Card, make sure that your card is supported by Linux. Some of the best oes are ATI/AMD, Nvidia and others.

Low End Video Cards

Low end video cards supported by Linux include the Intel X3100 GMA, Intel GMA 4,500 MHD, Intel 950 GNvidia Quadro NV.

Mid to High-End Video Cards

The Nvidia Quadro FX 88M (1024 MB) and FX 2,800M (1024 MB), the Quadro NVS 3,100 M (256 MB or 514 MG). Nvidia GeForce 9,300 M GS, Nvidia GeForce 9,300 M are all options for mid to high bandwidth

RAM

RAM defines the speed of your laptop most of the time. Hence, if you’re going to do stuff that are RAM intensive, then you need to choose one which has abundance of the same. Applications like GIMP etc. are RAM intensive.

Hard Disk

More the hard disk space, more the data that you can store. In Linux, this is also used to boot into the system. You can also use solid state drives, which are twice as fast are normal hard disks. They also require less power and are quieter.

Optical Disk

DVDs, Blu Ray and other such optical formats are not supported on Linux. So, you need to get the optical disks that can run DVDs. A DVD burner is usually good for this purpose. If you plan to watch Blu Ray movies, then a Blu ray optical disk would be what you are looking for.

Power Management: Suspend and Hibernate

Both Advanced Power Management (APM) and Advanced Configuration and Power Interface (ACPI) are supported by the Linux system. This is what allows the user to hibernate their system to a particular partition on the disk.

Wireless 802.11

While most Linux-based systems come with a Wireless 802.11 wireless card, if you’re not paying attention to this aspect, it might end up disrupting another device as well. The Intel Pro series cards and the Atheros-based cards are the best for Linux systems.

Biometric Fingerprint Scanner

This will depend on the level of security you’re looking for on your system. If you think you need your laptop to be highly secure, then this is the way to go. Laptops like the Dell Latitute, HP Pavillion etc. have this feature.

Ports

USB, FireWire and eSATA ports are the most common for laptops. While the USB port is quite well suited in Linux, the FireWire port sometimes doesn’t work correctly. The eSATA port is used to connect external SATA drives to the SATA bus directly.

Docking Station (Port Replicator)

While most docking stations work smoothly, it is advisable to confirm before buying whether a particular docking station is good with Linux. These are used to connect external electronic devices to your laptop.

Recommend Linux Distribution

Use a recommended Linux distribution. Any flavour of the Ubuntu distribution is a good choice. If you’re looking for others, then Fedora Linux, OpenSuse Linux and Debian Linux can also be used.

Linux Laptop Vendors

Dell, HCL, Acer, HP, Asus... all provide Linux-based laptops. They often have their preference of the Linux distribution though. For example, Dell goes only for Redhat-based Linux systems for business purposes in India.


Fonte: A Guide To Buying A Linux Laptop

Here's A List Of 83 Linux Commands For Beginners!

Here's A List Of 83 Linux Commands For Beginners!

Switching to Linux was a wonderful decision, now it's time to explore its power - the command line!

So you have just switched to Linux and trying to figure out what was the fuss about the command prompt as the most powerful tool. Well here's a list of Linux commands for a beginner to help you get a glimpse of what the command prompt can do for you.

Viewing, copying, moving and deleting files

ls Display the contents of the current directory
ls -a Display also hidden files and hidden directories
   
cp filename /path/dir_name Copy filename into directory /path/dir_name
cp -r dir_name /path/dir_name2 Copy the entire dir_name into /path/dir_name2
cp filename1 filename2 /path/dir_name Copy filename1 and filename2 into /path/dir_name
   
rm name Remove a file or directory called name
rm -r name Remove an entire directory as well as its included files and subdirectories
   
mv filename /path/dir_name Move filename into /path/dir_name
mv filename1 filename2 Rename filename1 to filename2
   
cat filename Display filenames contents
   
more filename Display filename in pages. Use spacebar to view next page
   
head filename Display filenames first 10 lines
head -15 filename Display filenames first 15 lines
   
tail filename Display filenames last 10 lines
tail -15 filename Display filenames last 15 lines
   
pwd Display current directory
   
cd /path/dir_name Change to directory /path/dir_name
cd .. Go 1 directory up
   
mkdir dir_name Create directory dir_name
rmdir dir_name Delete directory dir_name
 

Finding files and text within files

updatedb Update (create first time used) a database of all files under the root directory /
locate filename Find file filename searching in the database
   
find / -name filename Starting from the root directory search for the file called filename
find / -name *filename Same as above but search for file containing the string filename
   
grep string /path/dir_name Starting from /path/dir_name search for all files containing string
   
which application_name Search $path for application app_name
whereis application_name Search $path, man pages and source files for application_name
 

Archived files

Decompress
tar -xzf filename.tgz Decompress tzg file
tar -xzf filename.tar.gz Decompress tar.gz file
tar -xjf filename.tar.bz2 Decompress tar.bz2 file
 
Compress
tar -czf filename.tar /path/dir_name Compress directory /path/dir_name to filename.tar
gzip -c filename > filename.gz Compress /path/dir_name to filename.tar.gz
bzip2 -c filename > filename.bz2 Compress /path/dir_name to filename.tar.bz2
 

Using rpm files 

rpm -hiv package.rpm Install rpm called package.rpm
rpm -hiv --force package.rpm Install rpm called package.rpm by force
rpm -hUv package.rpm Upgrade rpm called package.rpm
rpm -e package.rpm Delete rpm called package.rpm
rpm -qpil package.rpm List files in not-installed rpm called package.rpm
rpm -ql package.rpm List files in installed rpm called package.rpm
rpm -q str List installed rpms containing the string str
rpm -qf /path/application_name Display the rpm that contains application application_name
 

Starting and Stoping 

startx Start the X system
shutdown -h now Shutdown the system now and do not reboot
halt
Same as above
shutdown -r now Reboot
reboot Same as above
shutdown -r +10 Reboot in 10 minutes
   

Mounting filesystems

mount -t vfat /dev/sd(a)(1) /mnt/c_drive Mount the first partition 1 of the first hard disk drive a which is in fat32 vfat dormat under /mnt/c_drive directory
mount -t iso9660 /dev/cdrom /mnt/cdrom Mount cdrom under /mnt/cdrom directory
   
umount /mnt/hda1 Unmout the above
 

User administration

users Display users currently logged in
adduser username Create a new user called username
passwd username Define password for user called username
who List logged-in users
whoami Display current user
finger username Displays info about user username
su Log in as root from current login
su - Log in as root from current login and take root's path
exit Exit from console login (ie, logout).
 

Processes 

command Execute command in the foreground
command & Execute command in the background
ctrl+z Suspend a program
ctrl+c Interrupt a program
ps List all processes
kill -9 pid Kill process with id pid
top Monitor processes in real time
 

Networking 

hostname List the system's hostname
ifconfig Set/Display network information
host ip Resolves ip's hostname
ping ip/hostname Check if ip/hostname is reachable
traceroute ip/hostname Find network path to ip/hostname
   

System Information

uname -a General system information
fdisk -l List partition tables
cp filename /path/dir_name Copy filename into directory /path/dir_name
df -T -h List filesystem disk space usage
lspci List PCI devices
lsusb List USB devices
free -m Display RAM+Swap usage
 

Program Compile

gcc -o output file.c Compile a C program
./output Run a C program you have compiled
g++ -o output file.cpp Compile a C++ program
./output Run a C++ program you have compiled
./configure && make && su -c 'make install' Configure, compile and install a program with Makefile

List Courtesy: my-guides
 
 

Fonte: Here's A List Of 83 Linux Commands For Beginners!

12 Linux Commands That You Should Keep As Reference

Friday, January 03, 2014:  System commands for Linux are not the most difficult, but when you've been in front of the command line, it can be easy to forget the right command. Keep this list handy as a reference for when you need them!

1. uptime: This command shows how long the system has been running. It also shows the number of users that are logged into the system along with the load average for intervals of one, five and 15 minutes.

# uptime

Output: 08:16:26 up 22 min, 1 user, load average: 0.00, 0.03, 0.22

2. w: This command shows you the users that are currently logged in to the system along with the processes they are running and load averages. You will also get the login name, remote host, tty name, idle time, login time, JCPU, PCPU, command and processes.

# w

Output: 08:27:44 up 34 min, 1 user, load average: 0.00, 0.00, 0.08
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
tecmint pts/0 192.168.50.1 07:59 0.00s 0.29s 0.09s w


Modify the command using these options:

-h : header entries.
-s : don’t show JCPU and PCPU.
-f : Removes from field.
-V : (upper letter) – Shows versions.

3. users: This command shows you the users that are currently logged in to the system. It doesn’t have any parameters.

4. who: You will use this command to get the username, date, host information and time. It is quite similar to the w command except that who doesn’t show the users’ processes.

# who

Output: xyz pts/0 2012-09-18 07:59 (192.168.50.1)

You can modify the command with the following:

-b : Date and time of last system reboot.
-r : Current runlet.
-a, –all : Show all information cumulatively.

5. whoami: You can also use this command as who am i. It will print the name of the current user of the system. It returns ‘root’ when you are logged in as root using the sudo command.

# whoami

Output: xyz

6. ls: This command will display the list of files in a readable format. A format that humans can read that is.

# ls -l

Output: total 114
dr-xr-xr-x. 2 root root 4096 Sep 18 08:46 bin
dr-xr-xr-x. 5 root root 1024 Sep 8 15:49 boot


If you need to sort the files as per the last modified time, then use this:

# ls -ltr

Output: total 40
-rw-r--r--. 1 root root 6546 Sep 17 18:42 install.log.syslog
-rw-r--r--. 1 root root 22435 Sep 17 18:45 install.log
-rw-------. 1 root root 1003 Sep 17 18:45 anaconda-ks.cfg


7. crontab: This command lists the scheduled jobs for the current user.

# crontab -l

Output: 00 10 * * * /bin/ls >/ls.txt

8. Less Command: This command is used to quickly view a file. You can use ‘q’ to quit and page up and page down to go up and down on the window.

# less install.log

Output: Installing setup-2.8.14-10.el6.noarch
warning: setup-2.8.14-10.el6.noarch: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Installing filesystem-2.4.30-2.1.el6.i686
Installing ca-certificates-2010.63-3.el6.noarch
Installing xml-common-0.6.3-32.el6.noarch
Installing tzdata-2010l-1.el6.noarch
Installing iso-codes-3.16-2.el6.noarch


9. more: This is the command that you use when you want to view a file in detail. It also shows a percentage. You can use page up, page down and ‘q’ just like you did with the less command.

# more install.log

Output: Installing setup-2.8.14-10.el6.noarch
warning: setup-2.8.14-10.el6.noarch: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Installing filesystem-2.4.30-2.1.el6.i686
Installing ca-certificates-2010.63-3.el6.noarch
Installing xml-common-0.6.3-32.el6.noarch
Installing tzdata-2010l-1.el6.noarch
Installing iso-codes-3.16-2.el6.noarch
--More--(10%)


10. cp: Use this command to copy files from the source to the destination while using the same mode.

# cp -p fileA fileB

If a file is being overwritten then you will be prompted.

# cp -i fileA fileB

11. mv: Use this command when you want to rename a file. Using the –I modifier will prompt you if something is being overwritten.

# mv -i fileA fileB

12. cat: Use this command when you want to view more than one files at the same time.

# cat fileA fileB

In order to view a file that doesn’t fit in one screen, use the more or less commands along with cat. 

# cat install.log | less

# cat install.log | more 

Fonte= 12 Linux Commands That You Should Keep As Reference

Siga-nos