linux⼼得及命令
⼼得:⽤xshell,xftp登陆的那个ip地址是公⽹的ip地址
yum install ... 这个命令是在线安装应⽤的
记得将java的jdk和tomcat解压在/usr/local路径下
1:which是⽤来查看⼀个⽂件是否存在,若存在就返回该⽂件所在的路径,返回的是执⾏路径,find返回的是安装路径,如下所⽰[root@izumce51w0ruacz ~]# which tomcat
/usr/sbin/tomcat
2:cd是进⼊⼀个⽬录,ls是显⽰这个⽬录下的所有⽂件,如下所⽰
[root@izumce51w0ruacz ~]# cd /usr/sbin
[root@izumce51w0ruacz sbin]# ls
accessdb grub2-install postcat
addgnupghome grub2-mkconfig postconf
addpart grub2-ofpathname postdrop
adduser grub2-probe postfix
agetty grub2-reboot postkick
aliyun_installer grub2-rpm-sort postlock
aliyun-service grub2-set-default postlog
aliyun-service.backup grub2-setpassword postmap
alternatives grub2-sparc64-setup postmulti
anacron grubby postqueue
applygnupgdefaults gshelld postsuper
arp halt poweroff
arpd hardlink ppp-watch
arping hwclock pwck
atd iconvconfig pwconv
atrun iconvconfig.x86_64 pwhistory_helper
audispd ifcfg pwunconv
auditctl ifconfig rdisc
auditd ifdown readprofile
augenrules ifenslave reboot
aureport ifstat redhat_lsb_trigger.x86_64
ausearch ifup resize2fs
authconfig init resizepart
authconfig-tui insmod restorecon
autrace install-info rmmod
avcstat installkernel route
badblocks intel-microcode2ucode routef
biosdecode ip routel
biosdevname ip6tables rsyslogd
blkdeactivate ip6tables-restore rtacct
blkdiscard ip6tables-save rtcwake
blkid ipmaddr rtmon
blockdev iprconfig rtpr
bridge iprdbg rtstat
btrfs iprdump runlevel
btrfsck iprinit runuser
btrfs-convert iprsos sasldblistusers2
btrfs-debug-tree iprupdate saslpasswd2
btrfs-find-root ipset sefcontext_compile
btrfs-image iptables selabel_digest
btrfs-map-logical iptables-restore selabel_lookup
btrfs-select-super iptables-save selabel_lookup_best_match
btrfstune iptunnel selabel_partial_match
btrfs-zero-log irqbalance selinuxconlist
build-locale-archive kdump selinuxdefcon
cacertdir_rehash kexec selinuxenabled
capsh killall5 selinuxexeccon
cbq kpartx selinux_restorecon
cfdisk lchage semodule
chcpu ldattach sendmail
chkconfig ldconfig sendmail.postfix
chpasswd lgroupadd service
chronyd lgroupdel sestatus
chroot lgroupmod setcap
clock lid setenforce
clockdiff lnewusers setfiles
consoletype lnstat setsebool
cracklib-check load_policy sfdisk
cracklib-format logrotate shutdown cracklib-packer logsave slattach
cracklib-unpacker losetup sln
create-cracklib-dict lpasswd smtp-sink
crond lpc smtp-source
ctrlaltdel lpc.cups ss
ctstat lsmod sshd
debugfs luseradd sshd-keygen delpart luserdel sulogin
depmod lusermod sushell
devlink makedumpfile swaplabel dhclient matchpathcon sw
apoff
dhclient-script mii-diag swapon dmfilemapd mii-tool switch_root dmidecode mkdict sysctl
dmsetup mkdumprd sys-unconfig dmstats mke2fs tc
dracut mkfs tcpdump
dumpe2fs mkfs.btrfs tcpslice
e2freefrag amfs telinit
e2fsck 2 tickadj
e2image 3 tomcat
e2label 4 tracepath
e2undo mkfs.minix tracepath6
e4defrag mkfs.xfs tune2fs
eapol_test mkhomedir_helper tuned ebtables mklost+found tuned-adm ebtables-restore mkswap udevadm ebtables-save modinfo unix_chkpwd
ecs_mq_rps_rfs modprobe unix_update eni-ifscan nameif update-alternatives eni-version netreport useraddlinux的vi编辑器命令
ether-wake NetworkManager userdel ethtool new-kernel-pkg usermod
faillock newusers usernetctl
fdformat nl-class-add vigr
fdisk nl-class-delete vipw
filefrag nl-classid-lookup virt-what
findfs nl-class-list virt-what-cpuid-helper firewalld nl-cls-add visudo
fixfiles nl-cls-delete vmcore-dmesg
fsck nl-cls-list vpddecode
fsck.btrfs nl-link-list weak-modules
<2 nl-qdisc-add wpa_cli
<3 nl-qdisc-delete wpa_4 nl-qdisc-list wpa_supplicant fsck.minix nologin xfs_admin
fsck.xfs nscd xfs_bmap
fsfreeze nstat xfs_copy
fstrim ntpd xfs_db
fuser ntpdate xfs_estimate
fxload ntpdc xfs_freeze genhomedircon ntp-keygen xfs_fsr genhostid ntpq xfs_growfs
genl ntptime xfs_info
genl-ctrl-list ownership xfs_io
getcap packer xfs_logprint getenforce pam_console_apply xfs_mdrestore getpcaps pam_tally2 xfs_metadump getsebool pam_timestamp_check xfs_mkfile glibc_post_upgrade.x86_64 parted xfs_ncheck groupadd partprobe xfs_quota groupdel partx xfs_repair groupmems pidof xfs_rtcp groupmod ping6 xtables-multi
grpck pivot_root zdump
grpconv plipconfig zic
grpunconv plymouthd zramctl
grub2-bios-setup plymouth-set-default-theme
grub2-get-kernel-settings postalias
3:加上./就到startup.sh了,不加就没到
3:加上./就到startup.sh了,不加就没到
[root@izumce51w0ruacz bin]# startup.sh
-bash: startup.sh: command not found
[root@izumce51w0ruacz bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.27
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.27
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.27/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/apache-tomcat-8.5.27/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.27/bin/tomcat-juli.jar
Tomcat started.
4:解压缩的命令,tar zxvf + 名字,如下所⽰
[root@izumce51w0ruacz local]# tar zxvf apache-tomcat-8.5.
5:只写cd是返回顶层的命令,cd ..注意中间有个空格这是返回上⼀层的命令,直接ls不能显⽰⽂件数量,只有先cd /才能显⽰⽂件数量(相当于桌⾯的⽂件数量),如下所⽰
[root@izumce51w0ruacz /]# cd
[root@izumce51w0ruacz ~]# cd /
[root@izumce51w0ruacz /]# ls
bin etc jdk-9.0.4_linux-x64_ lost+found opt run sys var
boot home lib media proc sbin tmp
dev jdk-9.0.4 lib64 mnt root srv usr
6:⽤cd的时候如果下⼀层还是⽂件夹,那么就可以直接写⽂件夹的名字,如果是⽂件的话,就必须写成./+⽂件名的形式,不然不到,vi+⽂件名是⽤来编辑⽂件的,记得按了回车[root@izumce51w0ruacz bin]# cd ..
[*************************************.27]#cdlogs
[root@izumce51w0ruacz logs]# catalina.out
-bash: catalina.out: command not found
[root@izumce51w0ruacz logs]# ./catalina.out
-bash: ./catalina.out: Permission denied
[root@izumce51w0ruacz logs]# cd ..
[*************************************.27]#cdconf
[root@izumce51w0ruacz conf]# vi ./l
7:⼀个⽹上的博客
解决 linux 的 bash:vi:command not find
转载 2017年07⽉03⽇ 10:31:24 2398
Linux命令⾏输⼊命令执⾏后报“bash:vi:command not found”这是由于系统PATH设置问题,PATH没有设置对,系统就⽆法到精确命令了。
1、在命令⾏中输⼊:export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin 这样可以保证命令⾏命令暂时可以使⽤。命令执⾏完之后先不要关闭终端。
2、在命令⾏中输⼊ vi /etc/profile 查看是否⾃⼰另外设置了PATH属性。
在Vi编辑器中输⼊
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
我的linux系统是由于设置pig环境变量时设置PATH属性导致command not found错误,所以我本机的PATH属性设置如下:
export JAVA_HOME="/usr/local/Java/jdk1.6.0_45"
export CLASSPATH=".:/usr/local/java/jdk1.6.0_45/lib:/usr/local/java/jdk1.6.0_45/jre/lib"
pathmunge /usr/local/java/jdk1.6.0_45/bin:/usr/local/java/jdk1.6.0_45/jre/bin:/usr/local/pig-0.9.2/bin
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
3、保存profile,执⾏source ~/.etc/profile,是profile⽣效,然后测试下vi命令,执⾏成功。
8:find查命令的⽤法
[root@izumce51w0ruacz ~]# find / -name java
/jdk-9.0.4/bin/java
/var/lib/alternatives/java
/etc/alternatives/java
/etc/pki/ca-trust/extracted/java
/
etc/pki/java
/etc/java
/usr/share/java
/usr/bin/java
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre/bin/java
/usr/lib/java
9:source命令是配置玩环境变量后使⽤的,使⽤之后就可以⽣效
[root@izumce51w0ruacz bin]# source /etc/profile
10:mkdir创建⽂件夹
[root@izumce51w0ruacz usr]# mkdir java
[root@izumce51w0ruacz usr]# cd java
[root@izumce51w0ruacz java]# mkdir packages
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论