linux
TRANSCRIPT
![Page 1: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/1.jpg)
LAMP Stands ForLAMP Stands For
L - Linux
A - Appache
M - MySQL
P - Php
![Page 2: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/2.jpg)
LINUXLINUX
Definition:Definition:
Linux is a free open source Operating System, based on Unix. It is available from many vendors with optional paid for support and provides an increasingly viable alternative to the Win 32, platform.
![Page 3: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/3.jpg)
Syntax: mkdir Example: mkdir [option] directory
Make DirectoryMake Directory
![Page 4: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/4.jpg)
Syntax: cd Example: cd ..
CHANGE DIRECTORYCHANGE DIRECTORY
![Page 5: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/5.jpg)
Syntax: mv Example: mv testdir newnamedir
CHANGE THE NAME OF CHANGE THE NAME OF DIRECTORYDIRECTORY
![Page 6: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/6.jpg)
REMOVE AN EXISTING REMOVE AN EXISTING DIRECTORYDIRECTORY
Syntax: rmdir Example: rm -r
![Page 7: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/7.jpg)
LISTING OF DIRECTORYLISTING OF DIRECTORY
Syntax: ls Example: ls
![Page 8: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/8.jpg)
COPY FILECOPY FILE
To copy file use Syntax: cp Example: cp myfile yourfile
![Page 9: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/9.jpg)
Creates a symbolic link to a Creates a symbolic link to a filefile
Make links between files, by default, it makes
hard links; with the `-s' option, it makes symbolic (or "soft") links.
Syntax: ln [Options]... target [Linkname]
ln [Options]... target... Directory
![Page 10: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/10.jpg)
SENDS FILE CONTENT TO SENDS FILE CONTENT TO STANDARD OUTPUTSTANDARD OUTPUT
To send a file content to standard output use Syntax: cat
![Page 11: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/11.jpg)
PRINT WORKING DIRECTORYPRINT WORKING DIRECTORY
Syntax: pwd
Explanation:
It will show the current working directory
![Page 12: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/12.jpg)
CLEAR THE TERMAINAL SCREENCLEAR THE TERMAINAL SCREEN
Syntax: Clear
It clears the terminal screen.
![Page 13: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/13.jpg)
EXIT FROM A LOOPEXIT FROM A LOOP Exit from a for, while, until, or select loop
Syntax: break [n]
If n is supplied, the nth enclosing loop is exited. n must be greater than or equal to 1.
The return status is zero unless n is not greater than or equal to 1.
![Page 14: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/14.jpg)
COMPARE TWO FILECOMPARE TWO FILE Compare two files, and if they differ,
tells the first byte and line number where they differ.
You can use the `cmp' command to show the offsets and line numbers where two files differ. `cmp' can also show all the characters that differ between the two files, side by side.
Syntax: cmp options... FromFile [ToFile]
![Page 15: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/15.jpg)
COMPARE DIFFERENT FILESCOMPARE DIFFERENT FILES Display the differences between two files,
or each corresponding file in two directories.
Each set of differences is called a "diff" or "patch". For files that are identical, diff normally produces no output; for binary (non-text) files, diff normally reports only that they are different.
Syntax: diff [options] from-file to-file
![Page 16: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/16.jpg)
DIVIDE A FILE INTO SEVERAL PARTSDIVIDE A FILE INTO SEVERAL PARTS Divide a file into several parts (columns)Writes to standard output selected parts of
each line of each input file, or standard input if no files are given or for a file name of `-'.
Syntax: cut [OPTION]... [FILE]...
![Page 17: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/17.jpg)
DISPLAY OR CHANGE THE DATE DISPLAY OR CHANGE THE DATE AND TIMEAND TIME
Display or change the date.
Syntax: date [option]... [+Format] date [option] [MMDDhhmm[[CC]YY][.ss]]
`date' with no arguments prints the current time and date, in the format of the %c directive.
![Page 18: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/18.jpg)
DISK CALCULATORDISK CALCULATORSyntax: dc <options>
Option: -e EXPR --expression=EXPR Evaluate EXPR as DC commands.
-f FILE --file=FILE Read and evaluate DC commands from
FILE.
![Page 19: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/19.jpg)
DISPLAY FREE DISK SPACEDISPLAY FREE DISK SPACE
Disk Free - display free disk space. With no arguments, `df' reports the space
used and available on all currently mounted filesystems (of all types). Otherwise, `df' reports on the filesystem containing each argument file.
Syntax: df [option]... [file]...
![Page 20: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/20.jpg)
PRINT OR SET SYSTEM NAMEPRINT OR SET SYSTEM NAME Print or set system name
Syntax: hostname [name]
With no arguments, `hostname' prints the name of the current host system. With one argument, it sets the current host name to the specified string. You must have appropriate privileges to set the host name.
![Page 21: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/21.jpg)
Syntax:Syntax:bash bash
GNU Bourne-Again SHell
![Page 22: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/22.jpg)
CURRENT USERCURRENT USER
Syntax: whoami
Print the current user id and name (`id -un')
![Page 23: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/23.jpg)
CURRENTLY LOGGEDCURRENTLY LOGGED
Syntax: who Print all usernames currently
logged in
![Page 26: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/26.jpg)
TEXT EDITORTEXT EDITOR
Syntax: Vi Used to edit text
![Page 27: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/27.jpg)
CURRENT LOGIN NAMECURRENT LOGIN NAMEPrint current login name
Syntax: logname
Prints the calling user's name, as found in the file`/var/run/utmp', and exits with a status of 0.
If there is no `/var/run/utmp' entry for the calling process, `logname' prints an error message and exits with a status of 1.
![Page 28: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/28.jpg)
COMMAND HISTORYCOMMAND HISTORYCommand Line history
Syntax: history history [n] history -c history -d offset history [-anrw] [filename] history -ps arg
![Page 29: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/29.jpg)
DISK USAGEDISK USAGE
Disk Usage - report the amount of disk space used by the specified files and for each subdirectory.
Syntax:
du [options]... [file]...
With no arguments, `du' reports the disk space for the current directory. Normally the disk space is printed in units of 1024 bytes, but this can be overridden.
![Page 30: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/30.jpg)
DISPLAY THE SYSTEM MEMORYDISPLAY THE SYSTEM MEMORY
Syntax:
Free
Displays the amount of used and free system memory.
![Page 31: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/31.jpg)
CREATE AN ALIASCREATE AN ALIASSyntax:
alias [-p] [name[=value] …]
unalias [-a] [name ... ]Key:
-p Print the current values
-a Remove All aliases
![Page 32: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/32.jpg)
SPELL CHECKERSPELL CHECKER
Syntax: aspell check [options] filename
Examples:
Check the file foo.txt: $ aspell check foo.txt$ aspell check foo.txt
![Page 33: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/33.jpg)
SEND TO BACKROUNDSEND TO BACKROUND
Syntax:bg [PID...]
Example:
Put the job with job id 0 in the background:
bg %0 bg %0
![Page 34: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/34.jpg)
KILLING PROCESSKILLING PROCESS
Syntax : kill process_ids
kill - signal process_ids
kill -l
Kills the specified processes, sends the specified processes the specified signal (given as a number or name), or
prints a list of available signals.
![Page 35: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/35.jpg)
KILL ALL THE PROGRAMSKILL ALL THE PROGRAMS
Syntax : killall program
killall - signal program
Kills all processes that are instances of the specified program or sends the specified signal to all processes that are instances of the specified program.
![Page 36: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/36.jpg)
REBOOT THE SYSTEMREBOOT THE SYSTEM
Syntax :
reboot
Reboots the system
![Page 37: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/37.jpg)
SHUTDOWN THE SYSTEMSHUTDOWN THE SYSTEM
Syntax :
shutdown -r minutes
Shuts down the system after the specified number of minutes elapses .
![Page 38: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/38.jpg)
SLEEP TIMESLEEP TIME
Syntax :
sleep time
Causes the command interpreter to pause for the specified number of seconds.
![Page 39: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/39.jpg)
An arbitrary precision calculator An arbitrary precision calculator language language
Syntax: bc options file... Explanation: bc is a language that supports
arbitrary precision numbers with interactive execution of statements. bc starts by processing code from all the files listed on the command line in the order listed. After all files have been processed, bc reads from the standard input. All code is executed as it is read.
![Page 40: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/40.jpg)
Run a shell builtinRun a shell builtinRun a shell builtin, passing it args, and return
its exit status.
SYNTAX: builtin [shell-builtin [args]]
This is useful when defining a shell function with the same name as a shell builtin, retaining the functionality of the builtin within the function.
![Page 41: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/41.jpg)
Conditionally perform a Conditionally perform a commandcommand Conditionally perform a command, case will
selectively execute the command-list corresponding to the first pattern that matches word.
Syntax: case word in [ [(] pattern [| pattern]...) command-case word in [ [(] pattern [| pattern]...) command-
list ;;]... esaclist ;;]... esac
The `|' is used to separate multiple patterns, and the `)' operator terminates a pattern list. A list of patterns and an associated command-list is known as a clause. Each clause must be terminated with `;;'.
![Page 42: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/42.jpg)
Convert a full pathname to just Convert a full pathname to just a path a path
Convert a full pathname to just a path
Syntax dirname pathname
Prints all but the final slash-delimited component of a string (presumably a filename).
If PATHNAME is a single component, `dirname' prints `.'
![Page 43: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/43.jpg)
Estimate file space usageEstimate file space usageDisk Usage - report the amount of disk space
used by the specified files and for each subdirectory.
Syntax du [options]... [file]...
With no arguments, `du' reports the disk space for the current directory. Normally the disk space is printed in units of 1024 bytes, but this can be overridden
![Page 44: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/44.jpg)
Display message on screenDisplay message on screenDisplay message on screen, writes each given
STRING to standard output, with a space between each and a newline after the last one.
Syntax echo [options]... [string]...
![Page 45: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/45.jpg)
Eject removable mediaEject removable mediaSyntax eject -h eject [-vnrsfmqp] [<name>] eject [-vn] -d eject [-vn] -a on|off|1|0 [<name>] eject [-vn] -c slot [<name>] eject [-vn] -t [<name>] eject [-vn] -T [<name>] eject [-vn] -x <speed> [<name>] eject [-vn] -X [<name>] eject -V
![Page 46: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/46.jpg)
Enable and disable builtin shell Enable and disable builtin shell commands.commands.Syntax:
enable [-n] [-p] [-f filename] [-ads] [name …]
Options: -a list each builtin with an indication of
whether or not it is enabled. -d Delete a builtin loaded with `-f'. -f load the new builtin command name
from shared object filename, on systems that support dynamic loading.
-n Disable the names listed, otherwise names are enabled.
![Page 47: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/47.jpg)
Environment variablesEnvironment variables
Display, set, or remove environment variables, Run a command in a modified environment.
Syntax: env [OPTION]... [NAME=VALUE]...
[COMMAND [ARGS]...]
![Page 48: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/48.jpg)
Exit the shellExit the shell
Exit from a program, shell or log out of a Unix network.
Syntax: exit
If supported will exit you from the program, shell or log you out of network.
![Page 49: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/49.jpg)
Convert tabs to spacesConvert tabs to spaces
Convert tabs to spaces, write the contents of each given file, to standard output, with tab characters converted to the appropriate number of spaces. If no file is given, or for a file of `-', write to standard input
Syntax: expand [options]... [file]...
![Page 50: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/50.jpg)
Evaluate expressionsEvaluate expressions
Evaluate expressions, evaluates an expression and writes the result on standard output.
Syntax: expr expression...
![Page 51: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/51.jpg)
Do nothing, unsuccessfullyDo nothing, unsuccessfullyDo nothing, returning a non-zero (false) exit
status
Syntax: false
`false' does nothing except return an exit status of 1, meaning "failure". It can be used as a place holder in shell scripts where an
unsuccessful command is needed.
![Page 52: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/52.jpg)
Send job to foreground Send job to foreground
Send job to foreground
Syntax fg [PID...]
Options: If PID is specified, the job with the specified
group id is put in the foreground.
![Page 53: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/53.jpg)
Format disks or tapesFormat disks or tapes
Syntax: Format
![Page 54: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/54.jpg)
Comment / RemarkComment / RemarkSyntax: ###A comment or remark is indicated by starting
the line with the # character # This is a description # Another remark command # Another remark
Related commands: : (a colon) : [arguments]
![Page 55: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/55.jpg)
Run a command script in the Run a command script in the current shellcurrent shell
Run a command script in the current shell context.
Syntax . filename [arguments]
source filename [arguments]
A dot/period '.' is a synonym for 'source'
![Page 56: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/56.jpg)
Print a string until interruptedPrint a string until interruptedSyntax: YesYes
`yes' prints the command line arguments, separated by spaces and followed by a newline, forever until it is killed.
If no arguments are given, it prints `y' followed by
a newline forever until killed. The only options are a lone `--help' or `--
version'.
![Page 57: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/57.jpg)
Send a message to another user Send a message to another user
write
Send a message to another user
Syntax:
write user [ttyname]
![Page 58: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/58.jpg)
Print byte, word, and line countsPrint byte, word, and line counts
Print byte, word, and line counts, count the number of bytes, whitespace-separated words, and newlines in each given FILE, or standard input if none are given or for a FILE of `-'.
Syntax: wc [options]... [file]...Options: -c --bytes --chars Print only the byte counts.
![Page 59: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/59.jpg)
CREATE AN ALIASCREATE AN ALIAS
Syntax: alias [-p] [name[=value] …]
unalias [-a] [name ... ]Key:
-p Print the current values
-a Remove All aliases
![Page 60: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/60.jpg)
EXCUTE A COMMANDEXCUTE A COMMANDSyntax: exec [-cl] [-a name] [command
[arguments]]
Options: -l Place a dash at the beginning of the
zeroth arg passed to command. -c Causes command to be executed with
an empty environment. -a The shell passes name as the zeroth
argument to command.
![Page 61: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/61.jpg)
CONVERT AND COPY A FILECONVERT AND COPY A FILE
Convert and copy a file, write disk headers, boot records, create a boot floppy. dd can make an exact clone of an (unmounted) disk, this will include all blank space so the output destination must be at least as large as the input.
Syntax dd [Options]
![Page 62: Linux](https://reader035.vdocuments.site/reader035/viewer/2022062707/55858274d8b42aa7148b4a50/html5/thumbnails/62.jpg)
PRINT KERNAL MESSAGEPRINT KERNAL MESSAGE
Print kernel (and driver) messages, control the kernel ring buffer.
Syntax: dmesg [ -c ] [ -n level ] [ -s bufsize ]