1, withRootUser LoginLinux, create a directory/perm, in/permcreate file under directoryNewFile, Grant/permDirectory all users haverwxpermissions; Create a normal userWLR, switch toWLRExecution "Rm/perm/newfile"Is it possible to perform
[[Email protected]~]# mkdir/perm[[email protected] ~]# touch/perm/newfile[[email protected] ~]# chmod 777/perm[[email p Rotected] ~]# useradd wlr[[email protected] ~]# passwd WLR Change the password for user WLR. New Password: invalid password: Too short invalid password: Too simple to reenter the new password: passwd: All authentication tokens have been successfully updated. [[email protected] ~]# su-wlr[[email protected] ~]$ rm/perm/newfile RM: Do you want to delete the plain empty file "/perm/newfile" with write protection? Y[[email protected] ~]$ ls
2, in/rootcreate file under directoryNewfile2, move filesNewfile2to the/permdirectory under the same name asfile01; Change/perm/file01the owner of the file is the system userADMTo change the group that belongs to the System user group Games; Change/perm/file01file permissions are "rwxrw-r--"; in/permdirectory, respectively, tofile01generate a soft link fileFile01.softand a hard-link fileFile01.hard; Delete/permCatalogue
[[email protected] ~]# touch/root/newfile2[[email protected] ~]# mv/root/newfile2/perm/file01[[email protected] ~]# cho WN ADM/PERM/FILE01 [[email protected] ~]# chgrp games/perm/file01 [[email protected] ~]# chmod 764/perm/file01 [email Protected] ~]# ln-s/perm/file01/perm/file01.soft[[email protected] ~]# ln/perm/file01/perm/file01.hard[[email Protec Ted] ~]# rm-rf/perm/
3, view/ etcdetails of the directory (permissions, size, etc.);/etc/The details of the file under the directory, the paging/ etcDirectory Search5files that have been changed within minutes;/ Bootdirectory to find the file namedgrub.confFile and also list the details of the filein the root directory, locate the system that is larger than100MBless than150MBof the file
[[email protected] ~]# ls -ld /etcdrwxr-xr-x. 103 root root 12288 5 Month 28 03:49/etc[[email protected] ~]# ls -l /etc | More total dosage 1780drwxr-xr-x. 3 root root 4096 5 month 27 17:46abrtdrwxr-xr-x. 4 root root 4096 5 Month 27 17:49acpi-rw-r--r--. 1 root root 44 5 Month 27 17:54adjtime-rw-r--r--. 1 root root 1512 1 Month 12 2010aliases ..... ................... Omit part ..... ..... ..... ....... ................ [[email protected] ~]# find /etc -mmin -5 -a -typef # Because I didn't mend it, so I didn't [[EMAIL PROTECTED] ~]# FIND /BOOT -NAME GRUB.CONF-EXEC LS -L {} \;-RW-------. 1 root root 811 5 Month 27 17:52/boot/grub/grub.conf[[email protected] ~]# find / - size +204800 -a-size -307200find: "/PROC/30990/TASK/30990/FD/5": does not have that file or directory find: "/PROC/30990/TASK/30990/FDINFO/5": does not have that file or directory find: "/PROC/30990/FD/5": does not have that file or directory find: "/ PROC/30990/FDINFO/5 ": does not have that file or directory/mnt/sr0/images/install.img/sys/devices/pci0000:00/0000:00:0f.0/resource1/ Sys/devices/pci0000:00/0000:00:0f.0/resource1_wc
4, to see if the system is installedPHPa software package;grepViewApacheconfiguration file/etc/httpd/conf/httpd.confof theDocumentRootoption information; tree-like display/etc/httpdfile structure under directory
[[email protected] ~]# grepphp /root/install.log installed RPM Package [[email protected] ~]# grepdocumentroot /etc/httpd/ Conf/httpd.conf # documentroot: thedirectory out of which you will serve yourdocumentroot "/var/www/html" # this should be changedto whatever you set documentroot to.# documentroot/www/docs/ dummy-host.example.com[[email protected] ~]# tree/etc/httpd #tree系统用没有需要自己安装/etc /httpd├── conf│ ├── httpd.conf│ └── magic├── conf.d│ ├── php.conf│ ├── README│ └── Welcome.conf├── logs ->, .... /.. /var/log/httPd├── modules ->, .... /.. /usr/lib64/httpd/modules└── run ->, .... /.. /var/run/httpd
5 /etc/shadow view command
[[email protected] ~]# man 5shadownCannot open the Messagecatalog ' man ' for locale ' zh_cn. UTF-8 "(nlspath="/usr/share/locale/%l/lc_messages/%n ") No entry for Shadown insection 5 of the Manual[[email protected] ~] # HELPCDCD:CD [-l|-p] [dir] Change the shell working directory. Change the current directory to DIR. The default DIR is the value of Thehomeshell variable .... ..... ..... ................ ...... ..... ..... ..... .....
6, create a directory/comp, copy files/etc/servicesto the/compdirectory, respectively, theServicesfiles are compressed and generated. gz. zip. bz2three-format compressed package; copy Directory/ etcto the/compdirectory (keep directory attributes unchanged),etcDirectory compression Generationetc.tar.gz, putServicesall compressed packages for files are usedRMDelete (with only oneRMcommand, not executed three timesRMoperation);/compcreate file under directoryHidefile, and set to hide
[[email protected] ~]# mkdir /compcp /etc/ Services/comp[[email protected] ~]# cp /etc/services /comp[[email protected] ~]# cd /comp/[[email protected] comp]# zip services.zip services adding:services (deflated 80%) [[Email protected] comp]# bzip2 -k services[[email protected] comp]# gzip services[[email protected] comp]# rm -f services.* (-f forced Delete, no prompt confirmation) [[email protected]]# cp - rf /etc /comp[[email protected]]# cd /comp/[[email protected]]# tar - zcf etc.tar.gz etc[[email protected]]# touch hidefile[[email protected]]# Mv hidefile .hidefile
7 , find commands ifconfig the absolute path and determine which users of this command can execute; Change native IP address is 192.168.9.250 (change back after practice)
[[email protected] ~]# which ifconfig/sbin/ifconfig only root can use Ifconfig (the command under Sbin directory is only available for root execution) [[email protected] ~]# Ifconfig eth0 192.168.1.250
8 , Ping native address test, request send Ten Times ICMP package and the package size is + byte
[Email protected] ~]# ping-c 10-s 1000 192.168.1.250
9 , set command " CP-RF "Command alias is DIRCP , view current online users
[[email protected] ~]# vi~/.bashrc 1 # .bashrc 2 3 # user specific aliases and functions 4 5 alias rm= ' Rm -i ' 6 alias dircp= ' Cp -rf ' ... ..... ... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ....... [[email protected] ~]# whoroot pts/0 2015-05-28 04:14 (192.168.1.250)
Ten , view / etc directory under file name to . conf the end of the binary file has the number of
[Email protected] ~]# mkdir/test[[email protected] ~]# touch/test/find.list[[email protected] ~]# find/etc-name *.conf- A-type f >/test/find.list [[email protected] ~]# wc-l/test/find.list231/test/find.list
This article is from the "Wu-Dick" blog, please be sure to keep this source http://9827789.blog.51cto.com/9817789/1659882
linux-Basic Command Test (ii)