Saturday, September 14, 2013

Linux Commands

Well, today I bring basic Linux commands, so they can be managed and directed with this great OS, and above all a great way to manage Back Track, through the terminal can handle all our OS and it is also very necessary Learningthese commands 












More Commands

ls

list: list. It shows the contents of the folder you indicate later. Eg. If you want to show us what's in / etc:

# Ls / etc

If we do nothing interpret what we see is the contents of the folder where we are today:

# Ls

To show all files and folders, including hidden:

# Ls-a

To display the files and folders along with the rights you have, what occupies, etc:

# Ls-l

If we wanted to display the files in the same way as before, but also showing hidden:

# Ls-la
-------------------------------------------------- ---------------
CD

change directory: change directory. We can use it with absolute or relative paths. In the absolute we indicate all the way from the root (/). For example, wherever we are, if we write in console ...

# Cd / etc / apt ... will lead us to that folder directly.
# Cd / ... send us to the root of the file system.

Relative paths are relative to something, and that something is the folder where we are today. For example if we are in / home, and we go to a temporary folder called within our personal folder.

# Cd tu_carpeta / temporal

We avoided the / initial home because if not introduce draws on the directory where you are.

# Cd

What this does is it takes you directly to your personal folder and wherever we are, it's really very practical, very simple and that not everyone knows.
-------------------------------------------------- -------------- mkdir

make directory: make directory. Create a folder with the name that you indicate. We may use absolute and relative paths. We can tell you the whole path to the directory preceding it we want to create, or if we are in the folder that will contain just enough to put the name:

# Mkdir / home / your_account / cucumber

If you are in / home / your_account ...

# Mkdir cucumber
-------------------------------------------------- ---------------
rm

remove: delete. Deletes the file or folder that you indicate. As before you can enter the full path and file name. This from now we will ignore, I think it has become clear with the two previous commands.

To delete a file: # rm filename

To delete an empty folder: # rm foldername

To delete a folder containing files and / or other folders:

# Rm-r foldername

Other options: "-f" does not ask for confirmation to delete or "-v" shows what deleted.
-------------------------------------------------- ---------------
cp

copy: copy. Copy the file indicated where you say. Here we can also play with the routes, both for the source file, as in the destination. You can also put the name you want to give back. For example, if we were in / etc/X11 and would like to make a backup of xorg.conf in our personal folder:

# Cp xorg.conf / home / tu_carpeta / xorg.conf.backup
-------------------------------------------------- ---------------
mv

move: move. Same as above, only instead of making a copy, move directly the file with the name that you indicate, may be other than the original:

# Mv / etc / pepino.html / home / tu_carpeta / ese_pepino.html

Another very practical use that can be given is to rename a file. Simply enter the new name in the second argument with the same path of the first. In this example we assume that we are in the folder that contains:

# Mv pepino.html ese_pepino.html
-------------------------------------------------- --------------- 

find

find: find. Find the file or folder that you specify:

# Find /-name cucumber

The above command would look everywhere folders and files called cucumber. If we were sure that is located in / var for example, I indicaríamos:

# Find / var-name cucumber

If we're not sure of the name can indicate it with wildcards. Suppose we seek name contains "pepi" in the same folder as before:

# Find / var-name * pepi *

You have other options. For example we can tell you find files / folders over 1500 KB:

# Find /-size +1500

Or the files / folders containing the name "pepi" and have less than 1000 KB:

# Find /-name *-size cucumbers * -1000
-------------------------------------------------- ---------------
clear

clear: clear. Clears the screen / console.

# Clear
-------------------------------------------------- ---------------
ps

process status: status of the processes. It shows us what we want to know about the processes running on your system. Each process is identified by a number called PID. If we place ...

# Ps-A

... Will show a list of all processes, their PID to the left and to the right name. If you want more information:

# Ps aux



-------------------------------------------------- ---------------
kill

kill: kill. Kill the process we indicate with PID:
# Kill

Sometimes the process does not "die" at all, but you can force the system to safely kill him as follows:

# Kill -9
-------------------------------------------------- ---------------
sudo

super-user do: do as root. The user account in Ubuntu is relatively normal.Administrator has rights to half. I mean, it does, but every time you do something important and risk to the system, it must be done by the prefix "sudo" and then typing the password.

For example, something we've done many times in the tutorials is to make a backup of the xorg.conf file. It is located in the / etc/X11 and that any user can make changes or delete anything if you are not an administrator or have rights as such, thanks to sudo. So we always did:

# Sudo cp / etc/X11/xorg.conf / etc/X11/xorg.conf

Whenever we need to make a apt-get/aptitude update or install and actions of this type, we have to put before the "sudo".
-------------------------------------------------- ---------------
passwd

password: password. With this command you can change the password for our account. First we asked the current password as a security measure. After you are prompted for twice the new password.

# Passwd
-------------------------------------------------- ---------------
its

super-user: root. By 'her' we loguearnos as superuser. After writing it will ask for the root password and we as administrator.

# Su

This command also allows you to login with a different account. For example, imagine we have another account, besides root and ours, called "guest". To login as such would be sufficient to:

# His guest

and then enter the password for that account.

sudo passwd

Thanks to the combination of these two commands can change the password for root (the super-user).

# Sudo passwd
-------------------------------------------------- ---------------
man

Manual: manual.'s another powerful commands in linux. Program or command is normally comes with a complete help file on their use and their arguments.When desconozcáis how it is used and what arguments have a command or application you only have to type in console:

# Man name

Sometimes the information you provide us man can become excessive. Almost all commands and applications accept the argument "- help" to display more summarized some help. For example with aptitude:

# Aptitude - help




EXPLORING THE FILE SYSTEM

The file system is the collection of the hierarchy of files and directories on your system. Among the main directories are:

/ Bin
/ Bin stands for binaries or executables. It is where the majority of essential system programs. Most (if not all) of the files in / bin have an asterisk (*) appended to their names. This indicates that they are executable files.

/ Dev
The files in / dev are known as device drivers (device drivers) and are used to access system devices and resources such as hard drives, modems, memory, etc..

/ Etc
/ Etc contains a number of system configuration files. These include / etc / passwd (the user database), / etc / rc (system initialization scripts, etc.).

/ Sbin
/ Sbin is used to store essential system programs that use the same administrator
.
/ Home
/ Home contains the home directories of users. For example, / home / user is the user directory. In a newly installed system, there will be no users in this directory.

/ Lib
/ Lib contains the shared library images. These files contain code that share many programs. Instead of each program containing its own copy of the shared routines, they are stored in a common location in / lib. This makes executable files smaller and saves space on disk.

/ Proc
proc is a "virtual file system". The files that are stored in memory, not on disk. They refer to various processes running on the system, and let you get information about what programs and processes are running at any given time.

/ Tmp
Many programs have a need to generate some information and store it in a temporary file. The location for these files is / tmp

/ Usr
/ Usr directory is very important. It contains a number of subdirectories in turn contain some of the most important and useful programs and configuration files used in the system.

The directories described above are essential if the system is operational, but most things that are in / usr are optional for the system. Anyway, are those optional things that make the system useful and interesting.

/ Var
/ Var holds directories that often change their size and tend to grow.


COMMAND LIST 


LINUX COMMANDS
1acPrints statistics about how long users have been logged.
2adduserSee useradd.
3aliasCreate shortcuts to commands, list current aliases.
4apt-getTool actualizacón / remote installation packages on debian based systems.
5arpLets get / manipulate the list of MAC addresses / IP that the system sees.
6arpingSends ARP REQUEST to other computers on the network.
7arptablesFirewall iptables similar in function to control traffic but arp protocol.
8atWork program, commands, scripts for later execution.
9atqList scheduled jobs pending execution by the at command.
10awkAnalysis and processing of patterns in files and listings.
11basenameDelete the path name of a file.
12bcCalculator and mathematical language, very powerful.
13biosdecodeInformation on the BIOS.
14blkidDisplays block device attributes (disks, usb, etc..) Such as LABEL and UUID, among others.
15bzcatUnzip zipped files and packaged using bzip2.
16bzip2Compressor / decompressor files.
17bzmoreAllows you to view the contents of files using bzip2 compressed or packaged.
18limeDisplays a calendar.
19catDisplays the contents of files and concatenate files.
20CDChange directory.
21cfdiskDisk partitioning tool, used mainly debian systems.
22chageChange the information (expiration, revocation, etc.) of a user's password.
23chattrChange extended attributes of files and directories
24chfnChange the information used in finger.
25chgrpChanges the group of a file (s) or folder (s).
26chkconfigControls / query how services are running or not on startup.
27chmodChange the permissions on a file (s) or folder (s).
28chownChanges the owner of a file (s) or folder (s).
29chpasswdUpgrade passwords or passwords in batch mode. Passwords can update user groups.
30chrootExecute commands in a restricted shell root to a directory and its subdirectories.
31chshChange your default shell or login shell.
32cleanlinksCleans symlinks unrelated and also removes empty directories.
33clearClean the terminal.
34cmpCompare two files byte by byte.
35convertquotaConverts from the old formats and quota.group quota.user to new formats and aquota.group aquota.user.
36cpioCopy, create, and extract compressed files in different formats and across teams or locally.
37crontabManage cron files for users and root.
38curlAllows you to download or transfer url's.
39cutRemoves sections (columns mainly) of each line of a file or files.
40dateDisplays / sets the date and time.
41dcInteractive Calculator.
42ddConvert and copy files and file systems.
43ddateDisplays the date Discordant calendar format.
44dfDisplays space usage of hard disks or partitions.
45diffSearch and show differences between files.
46digUtility for querying DNS servers.
47dircolorsColor setup for ls.
48dirsTo show or manipulate the list of directories used in the stack. (See popd and pushd)
49dmesgDisplays messages system startup (boot).
50dmidecodeList computer hardware BIOS directly. (Also: lshw)
51dos2unixConverts MS-DOS format to format Unix / Linux.
52duDisplays space usage of files and directories.
53dumpAllows you to create backups for ext2 and ext3.
54EchoPrint a line of text, variables, or content to a file.
55edquotaManages disk quota control user and group.
56egrepSame as the command 'grep-E', to use regular expressions.
57ejectUnmount and eject removable media such as CD-ROMs.
58envRun a program in a modified environment.
59ethtoolAllows you to display or change values ​​of a network card.
60exitExits the current shell or terminal.
61expectCreate sequences of dialogues and interactive sessions scheduled with other commands or scripts.
62exportExports the value of a variable.
63exportfsKeeps a list of the type file systems that have been exported NFS.
64exprMathematical expression evaluator.
65factorFind the primes of a given number.
66fcAdd, edit and re-executes previously executed commands.
67fdiskDisk partitioning tool, common to almost all distros.
68fgrepIt's like 'grep-F' to use regular expressions in file searches and listings.
69fileDetermines the file type.
70findFile search, many search options.
71findfsFind a filesystem by UUID or LABEL (label).
72findsmbLists information about devices that respond to SMB packets. List a Windows network. (Part of Samba)
73fingerDisplays information about the system users.
74fortunePrints a random adage.
75fpingLets send ICMP packets (pings) to multiple computers on a network and determine if they are alive or not.
76freeShows the used and free space of RAM and Swap.
77fsckTool to verify / repair file systems.
78fuserIdentify processes using files or connections (sockets).
79gawkAnalysis and processing of patterns in files and listings. (Gnu version)
80gccC Compiler and GNU C + +.
81geditGnome text editor.
82gpasswdEnables management of the file / etc / group
83gpgTool generation encryption and security certificates (opengpg).
84grepLook for patterns of strings within files.
85groupaddCreate a new group in the system.
86groupdelRemoves a group in the system.
87groupmodModifies a group on the system.
88groupsPrints the groups to which a user belongs.
89gzipCompresses / expands files.
90haltTurn off the computer.
91hdparmSets and displays features on the hard drives.
92headDisplays the first lines of a file.
93helpHelp on bash internal commands.
94historyDisplays the user's command history.
95hostProps to query DNS server host.
96hostnameDisplays the computer name.
97htpasswdManage files of user / password for basic authentication of Apache.
98hwclockShows / Sets the date / time changes or hardware. (Date / Time system date)
99idDisplays the UID (User ID) and GID (Group ID) of the user
100ifconfigDisplays / Configures the system's network interfaces.
101ifstatSmall utility that allows you to observe statistics of network interfaces in real time.
102initInitialization control ejecucción level.
103insmodInsert modules into the kernel.
104ipcalcPerform simple calculations on IP addresses.
105ipcountIdentifying ranges of network IP's calculation.
106iptabDisplays an IP address table prefix according to CIDR
107iptablesFirewall configuration tool for Linux.
108iptrafNetwork traffic analyzer in text mode.
109iwconfigSet a wireless network card.
110iwlistGets detailed information about a wireless card.
111jobsDisplays user jobs in suspension or background.
112kateKDE Text Editor.
113killEnd processes, more correctly sends signals to processes.
114killallEnd processes with the same name or set.
115lastDisplays information of the last users logged.
116lastbDisplays information for the failed attempts last logged.
117lessDisplays the contents of an archive, searchable and was back and forth movement.
118lnCreate links (shortcuts) soft and hard of files and directories.
119localeSpecific information about the local environment variables.
120locateIndexes and searches for files. Safer use slocate.
121losetupDefines and controls devices such as 'loop'.
122lpqSample documents for printing in the print queue.
123lprAdd a document to the print queue.
124lsList files and directories.
125lshwList computer hardware BIOS directly. (Also: dmidecode)
126lsmodDisplays the status of the modules in the kernel.
127lsofDisplays open files in ejecucción program, or from a user, process, etc..
128lspciList pci devices in the system.
129lsusbList system usb devices.
130EmailSend and receive email.
131manDisplays the specified command manual.
132mcArchvivos Manager with mouse support in text mode, not every distro I have.
133mceditMc Text Editor.
134md5sumCheck (and creates) certifying signature files md5.
135mkdirCreate directories.
136mkfsBuild a Linux file system.
137mkpasswdPassword generator. (Program Package 'expect').
138modinfoDisplays information about kernel modules.
139modprobeTool to add / remove kernel modules.
140morePager similar to but less funcioanal less as it comes forward and retocede.
141mountMonta storage fixture by partitions indicated.
142mtoolsSet of utilities to access DOS disks from Linux.
143mvMoves files and directories.
144netstatNetwork Utility showing connections, routing tables, interface statistics, etc..
145niceRun a program with a priority other than normal ejecucción.
146nohupExecutes a program immune to hangups without access to a terminal.
147opensslControl, management, security certificate generation.
148partprobeTells the operating system of the changes listed in / etc / fstab
149passwdChanges the specified user's password.
150PingSends a ECHO_REQUEST (echo request) to a computer on the network.
151pkillSend signals to processes based on their attributes.
152popdRemoves entries (directories used) from the list of directories used in the stack. (See dirs and pushd)
153prFormat or convert text files for printing.
154psDisplays system processes or user or both.
155pstreeDisplays processes as a tree.
156pushdAdds entries (directories used) in the directory list (stack or stack).(See dirs and popd)
157pwckVerifies the integrity of the file / etc / passwd
158pwconvAdd or sets the shadow protect the / etc / passwd.
159quotaEnables the use of user fees.
160quotacheckCreate, verify, manage disk quota systems
161quotaoffDisables disk quotas control.
162quotaonActive control disk quotas for users and groups.
163rdesktopOpen graphics terminals has? Ia Windows computers.
164rebootRestart the computer.
165reniceChange the priority of a process or program in ejecucción.
166repquotaReport use of disk quotas.
167resolveipSolve the ip or host domain indicated.
168revReverses the lines of a file.
169rmClears or deletes files.
170routeDisplays / changes the IP routing table.
171rpmProgram installation / upgrade / removal of packages, redhat based distros.
172runlevelDisplays the current run level of the system above.
173scpCopy files between computers, part of openssh (encrypted communication protocol).
174screenManager virtual terminals.
175thirstOnline Editor filters and transforms files.
176serviceRun / stop services in manual mode.
177setDisplays or sets the environment variables for the user actuual.
178sha1sumCheck (and creates) certification signed archives sha1.
179shoptEnable or disable optional variables shell behavior.
180shredDelete files securely and unrecoverable.
181shutdownTurn off or restart your computer.
182sortSort lines of files and playlists
183ssProps like netstat but basic socket set fast listings.
184sshSecure remote login program, openssh package program (encrypted communication protocol).
185startxX. logs
186itsChange the current user indicated.
187sudoAllows user runs indicate that root commands.
188syncForza memory blocks to disk, update the super block.
189tacLike cat, sample and / or concatenated files in reverse.
190tailShows the end of a file.
191tailfSynonym tail-f command, allows real-time viewing the end of a file, ie as you type useful to monitor blogs.
192tarTool Packing / compressing of files.
193testparmCheck samba smb.conf file for errors or corrections.
194timeReturns the time that you ran the indicated command or program.
195topDisplays system processes interactively and continuously.
196touchCreate empty files, change access dates and / or modification of files.
197tputChange values ​​or terminal capabilities, based on terminfo.
198traceroutePrints the route network packets to the destination.
199ttyPrint the name of the terminal on which this.
200tzselectSet an area or time zone.
201umaskSets permissions mask when creating directories and files.
202umountUnmount file systems.
203unaliasRemoves alias command, created with the alias command.
204unameDisplays system information.
205uniqOmits or reports on repeated lines in a file or listing.
206unitsConverter units from one system to another, supports dozens of metrics.
207up2dateUpgrade Tool / remote installation packages (used in redhat, centos).
208uptimeShows how long has turned on the computer.
209urpmeUrpmi package program to uninstall or remove packages.
210urpmiUpgrade Tool / remote installation of packages rpm-based distros (used in mandriva).
211useraddAdd users.
212userdelRemoves users.
213usermodModifies user information.
214usersDisplays the user names of all users currently connected to the system.
215viVisual Editor screen, text editor, you find in all Linux distros.
216vimLike the saw but improved.
217visudoEditor for the configuration file / etc / sudoers sudo.
218vmstatProvides virtual memory information.
219wShows who is connected to the system and you are doing.
220wallSend a message to all terminals.
221warnquotaConfigure / etc / warnquota.conf to complement messages for disk quotas.
222wcAccount words, lines, characters of a file or listing.
223wgetFile Downloader from the Internet and not interactive.
224whatisShort description in a command line or program.
225whereisLocate the binary, source and / or libraries, and documentation of a comado.
226WhichShows the full path of a command.
227whoShows who is connected to the system.
228whoamiDisplays the current user.
229xhostAccess control for X sessions
230xkillKills or ends an X client, ie a graphics program.
231yesPrints a string repeatedly until terminated or killed the command.
232yumUpgrade Tool / remote installation of packages rpm-based distros (used in fedora, redhat and derivatives).
233zcatUnzip / sample files compressed with gunzip (identical to gunzip-c)
234zenityDisplays various types of dialogues in X from a terminal.
235zlessDisplay content archives.
236bzmoreDisplay content archives. 

0 comments:

Post a Comment