mac osx linux,Linux 、Mac OSX 常见问题 及 笔记
1.grep:Binary file (standard input) matches
[root@localhost]$ cat 20161102.csv|grep "20161027"
Binary file (standard input) matches
解決辦法:grep判斷該文件為二進制文件,需添加參數?-a
2.tar與zip壓縮時排除文件
zip命令:-x exclude the following names -i include only the following names
但 zip -r aaa.zip aaa -x /bbb/* 無效
正確方法:zip -r aaa.zip aaa -x \ccc\*,需要用反斜杠,或者:zip -r aaa.zip aaa -xbbb/*
tar命令:-zcvf aaa.tar.gz aaa --exclude=1 --exclude=2 無效
正確方法:tar -zcvf aaa.tar.gz --exclude=1 --exclude=2 aaa,需要先排除,后指定目錄
3.誤刪除libc.so.6的解決方法
Linux的很多命令都是依賴libc.so.6的動態鏈接庫,如果不小心把它刪除了,基本上所有命令都不能使用
LD_PRELOAD=/lib64/libc-2.12.so ln -s /lib64/libc-2.12.so /lib64/libc.so.6
4.<
ftp -n -i $HOSTNAME >> ftp.log << END
user $USERNAME $PASSWORD
binary
prompt
cd $FTPDIR
ls
bye
END
5.優化內存定時任務
0 1 * * * free && sync && echo 3 > /proc/sys/vm/drop_caches && echo "" && free
6.ssh、sftp非默認端口登錄
ssh -p 2222 user1@192.168.1.1
sftp -oPort=2222 user1@192.168.1.1
7./usr/bin/ld: crti.o: No such file: No such file or directory
rpm -ivh --nodeps glibc-devel-2.12-1.192.el6.x86_64.rpm
8.搜索jar包類名
jar tf quartz-1.6.6.jar |grep JobFactory
org/quartz/simpl/PropertySettingJobFactory.class
org/quartz/simpl/SimpleJobFactory.class
org/quartz/spi/JobFactory.class
9.修改用戶密碼不過期
chage -M 99999 nwom
總結
以上是生活随笔為你收集整理的mac osx linux,Linux 、Mac OSX 常见问题 及 笔记的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 几个使用linux内核的系统,[科普]
- 下一篇: linux 其他常用命令