Unix & Linux

Linux,FreeBSD和其他类似Un * x的操作系统用户的问答



3
shell脚本仍然可以在没有#的情况下工作!(sha-bang行)
我是shell脚本的新手,很多书都写过在脚本开始时使用#!(sha-bang)行来调用解释器,这将为脚本调用新的shell并逐行进行解释。我的基本脚本仍然没有魔术般运行。 所以我的问题是: 我的基本脚本是从哪里得到解释器的。 脚本如何设法找到解释器。 现在,让我告诉您我的基本脚本,它仅包含以下行: 回声“没有魔力的基本剧本”


1
给定私有SSH密钥,如何恢复我的公共密钥?
我以某种方式丢失了id_rsa.pub文件。我还有id_rsa档案。如何从私钥中恢复公钥? (ssh-copy-id在ssh-keygen报告“ /root/.ssh/id_rsa已经存在”的同时报告“错误:未找到身份” 之后出现了这个问题。ls ~/.ssh指出了问题所在,id_rsa但没有id_rsa.pub。我找到了解决方案,但它埋在了底部)在Ubuntu支持论坛上的一篇长文章)

1
查找时使用print0选项得到的输出更少?
我已经阅读了手册页和其他参考资料,但是仍然对find with -print0option 的行为感到困惑。 -print0 This primary always evaluates to true. It prints the pathname of the current file to standard output, followed by an ASCII NUL character (character code 0). 第一条命令: $ find /some/path/ -iname "*intro*jpeg" -o -iname "*intro*jpg" 2> /dev/null /some/path//asdf199Intro-5kqlw.jpeg /some/path/199intro-2jjaj.JPEG /some/path/199intro-3.jpg /some/path/wuer199intro-4.JPG /some/path/xbzf199INTRO-1.jpg 第二条命令: $ find …
10 find 

1
如何为Beagleboard构建从头开始的Cross Linux从头开始的GCC交叉编译器(CLFS)?
目前,我尝试按照Scratch的Cross Linux的说明从头开始构建嵌入式Linux 。 一切正常,直到我尝试编译GCC交叉编译器。我想为Beagleboard-xM构建Linux。因此,我选择了以下设置: export CLFS_ABI="aapcs-linux" export CLFS_HOST="x86_64-cross-linux-gnu" export CLFS_TARGET="armv7a-unknown-linux-uclibceabi" export CLFS_ARCH="arm" export CLFS_ENDIAN="little" export CLFS_ARM_ARCH="armv7" export CLFS_ARM_MODE="arm" export CLFS_FLOAT="hard" export CLFS_FPU="neon" 否,一旦我尝试运行此页面上的说明,该命令就会make all-gcc all-target-libgcc出错。 checking for armv7a-unknown-linux-uclibceabi-gcc... /mnt/clfs/sources/gcc-build/./gcc/xgcc -B/mnt/clfs/sources/gcc-build/./gcc/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/bin/ -B/mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/lib/ -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/include -isystem /mnt/clfs/cross-tools/armv7a-unknown-linux-uclibceabi/sys-include checking for suffix of object files... configure: error: in `/mnt/clfs/sources/gcc-build/armv7a-unknown-linux-uclibceabi/libgcc': configure: error: cannot compute …

2
在ls输出中突出显示最后更新的三个文件
有什么方法可以重载或包装ls命令,以便突出显示/下划线/否则使最后三个修改的文件清晰可见? 我知道我可以ls -rtl按逆向修改时间排序,但是尽管我想快速确定自己或另一个开发人员修改的最后一个文件,但我确实确实需要按字母顺序排列的文件列表。
10 linux  bash  command-line  ls 

3
我如何设置一个脚本,它将在FreeBSD中启动时运行?
我正在使用FreeBSD 9,我想编写一个脚本来检查是否连接了以太网电缆,如果连接了以太网电缆,请检查它。我想设置它以便它在计算机启动或登录时都可以运行。我看了我的UNIX书籍(它已经过时了,并且适用于一般UNIX,而不是专门针对FreeBSD),它说我可以使用crontab,但我只能这样做以使事情在某些时间运行,而不是在启动时运行。有人可以告诉我如何做到这一点吗?

5
百胜损坏的repomd.xml文件
我在Fedora 16上使用yum做任何事情都遇到麻烦。这是我得到的输出: [user@mycomputer yum-3.4.3]$ sudo yum update [sudo] password for user: Loaded plugins: langpacks, presto, priorities, refresh-packagekit adobe-linux-x86_64 | 39 B 00:00 ... http://linuxdownload.adobe.com/linux/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for adobe-linux-x86_64: Damaged repomd.xml file Trying other mirror. fedora | 39 B 00:00 ... http://download.fedoraproject.org/pub/fedora/linux/releases/16/Everything/x86_64/os/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for …
10 fedora  yum 


2
apt-get -f install卡在“损坏的文件系统tarfile”上
我apt-get在Raspberry Pi上遇到问题。这是我尝试安装软件包时的输出: pi@raspberrypi ~ $ sudo apt-get -f install cowsay Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: emacs23 : Depends: libm17n-0 (>= 1.6.1) but it is not going to …


3
使用emacs命令定制的vim(仅插入模式)
我曾经是emacs用户,所以必须切换到vim。但是我错过了一些在vim插入模式下的基本emacs命令: C-A C-E C-K C-Y C-x C-s ...和其他一些 我知道我可以先按Escape再按以下一些键,最后按键i: ^ $ d$ p :w [输入] ... 但是,我想保持vim插入模式,避免按Escape/ i键。 在网络上,我发现自定义设置emacs(vi-mode,vip,viper,vimpulse,vim-mode,evil)。但尚未发现相反的情况:vim使用emacs命令进行自定义... 我只emacs对vim 插入模式下的命令感兴趣。只是一些基本的命令,bash命令:C-A,C-E,C-K,C-Y,C-U...(是C-U不是默认的emacs命令,但我也喜欢它)。

1
使用setkeycodes将按下和释放的键映射到不同的“键”
我有一个带有滚轮的键盘,但在Ubuntu上不起作用,并且xev在移动键盘时命令不显示任何内容。但是通过dmesg命令我发现了这一点: 向上移动滚轮时: atkbd serio0: Unknown key pressed (translated set 2, code 0x8b on isa0060/serio0). atkbd serio0: Use 'setkeycodes e00b <keycode>' to make it known. 向下移动滚轮时: atkbd serio0: Unknown key released (translated set 2, code 0x8b on isa0060/serio0). atkbd serio0: Use 'setkeycodes e00b <keycode>' to make it known. 似乎是相同的键,但是如果向上/向下移动,则按下/释放的键会改变。 xmodmap -pke …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.