我一直在阅读有关 shell、终端、bash 的帖子,但我对这些术语越来越感到困惑。
难道DOS有一个壳,就像Linux中的bash的?
这是 DOS shell,一个显示命令行的 shell?
同样在这种情况下,如果我理解正确,终端是键盘和显示器?
mount -o uid=1000 /dev/sdb1 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
Run Code Online (Sandbox Code Playgroud)
它曾经有效,我不知道我错过了什么。
uname -r
3.19.0-21-generic
mount -V
mount from util-linux 2.25.2 (libmount 2.25.0: selinux, assert, debug)
Run Code Online (Sandbox Code Playgroud)
帮助表示赞赏。谢谢。
编辑:sdb1 上的文件系统是 ext4 编辑:
journalctl | tail -1
EXT4-fs (sdb1): Unrecognized mount option "uid=1000" or missing value
Run Code Online (Sandbox Code Playgroud)
编辑:当“它曾经可以工作”时,我在 USB 上有 vfat
我在网络上有一个带有文件夹视图的文件夹(http://example.com/folder1/folder2/)
/folder2 有多个文件夹,其中包含 pdf 文件。我想通过 ssh 将 /folder2 的所有内容下载到我的服务器,包括使用 wget 的所有子文件夹和文件。我已经尝试了以下但我一直只得到一个 index.html 和 robots.txt 文件。
[root@myserver downloads]# wget -r --no-parent --reject "index.html*" http://www.example.com/folder1/folder2/
--2015-08-07 07:46:36-- http://www.example.com/folder1/folder2/
Resolving www.example.com... 192.168.1.1
Connecting to www.example.com|192.168.1.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `www.example.com/folder1/folder2/index.html'
[ <=> ] 4,874,325 138K/s in 37s
2015-08-07 07:47:42 (128 KB/s) - `www.example.com/folder1/folder2/index.html' saved [4874325]
Loading robots.txt; please ignore errors.
--2015-08-07 07:47:42-- http://www.example.com/robots.txt
Connecting to www.example.com|192.168.1.1|:80... connected.
HTTP request sent, awaiting response... …Run Code Online (Sandbox Code Playgroud) 我有几个视频的srt字幕轨道mp4。我如何让他们mkv使用ffmpeg/ avconv?
我想有效地利用空间。在Darwin v13上执行转换。如果有人可以帮助我,我将不胜感激。提前致谢。
我可以使用任何为操作提供足够方便的环境的 shell。但是,我主要使用zsh.
/some/path
Lecture_About_Evolution_of_Evolution.mp4
english.srt
native.srt
perl.srt
elven.srt
Run Code Online (Sandbox Code Playgroud)
我要生成Lecture.mkv的出mp4文件和所有*.srt字幕轨道。但我不知道如何。
我有一个if条件。如果该条件为真,则将运行一个脚本,然后我需要检查另一个条件。
我怎样才能使用if语句或其他东西来做到这一点?
例如,
if [ condition -eq o ]
then
run script
again condition(this condition depends on above script output value)
run another script
else
exit
Run Code Online (Sandbox Code Playgroud) 关于mdutil和索引的两个问题:
-E选择?在我看来,它的意思是“重新索引”,但是以下 bash 命令对我来说没有意义mdutil -E -i off /。mdutil在系统中的某个任意文件夹上运行,它会递归索引所有子文件夹,而系统上没有其他任何内容吗?我有大致的想法,mdutil但我man mdutil对-E.
如何stdin立即为每一行执行命令?
示例:
(echo abc; sleep 10; echo def;) | ???
Run Code Online (Sandbox Code Playgroud)
该xargs工具不会完成这项工作,因为它会阻塞直到看到所有数据(等待 stdout 关闭)。然而,当新行可用时,我必须立即执行命令。
尝试sass --watch scss:css在目标文件夹内执行时,我收到了消息command not found
我知道我安装了 sass。gem list不再显示它已安装。
我运行sudo gem install sass并收到以下消息:
WARNING: You don't have /root/.gem/ruby/2.3.0/bin in your PATH
gem executables will not run.
Run Code Online (Sandbox Code Playgroud)
我去我的.bashrc档案。我有PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
我也把它放在/etc/bash.bashrc以防万一。没有什么改变。
我去 /etc/profile 并插入:
#Setting the GEM_PATH and GEM_HOME variables may not be necessary, check 'gem env' output to verify whether both variables already exist
GEM_HOME=$(ls -t -U | ruby -e 'puts Gem.user_dir')
GEM_PATH=$GEM_HOME
export PATH=$PATH:$GEM_HOME/bin
Run Code Online (Sandbox Code Playgroud)
我重新加载配置文件 . /etc/profile …
在列出 dups-23Mar16.listing 的长文本文件中,我想删除以.local. 以下是该文件中的一些行:
Desktop/Reisen/Italien/VillaLaBandita/images-hpz-urlaub/cimg0429.jpg
Desktop/Tiere/Italien/VillaLaBandita/images-hpz-urlaub/cimg0429.jpg
.local/share/files/eksteuer/ekst.odt
Run Code Online (Sandbox Code Playgroud)
从这个文件的外部,我可以用命令来做到这一点
sed -e '/^\.[a-z]/d' dups-23Mar16.listing
Run Code Online (Sandbox Code Playgroud)
并在 vi 缓冲区中
:%!sed -e '/^\.[a-z]/d'
Run Code Online (Sandbox Code Playgroud)
如果我也想删除以 Desktop 开头的行,我会成功
:%!sed -e '/^Desktop/d'
Run Code Online (Sandbox Code Playgroud)
如何将两个命令合二为一?我试过
:%!(sed -e '/^\.[a-z]/d';sed -e '/^Desktop/d')
Run Code Online (Sandbox Code Playgroud)
但这不起作用。解决办法是什么?
我在查找目录和子目录中的唯一命名文件时遇到问题。文件的名称必须是唯一的,而不是 md5 总和或内容。
我设法使用此代码获得了唯一文件的列表,但只有名称,而不是它们的位置(目录名称)。uniq如果目录名称在字符串中,则无法正确排序或使用...
find . -type f -name "*" | xargs -I% basename % | sort -u
Run Code Online (Sandbox Code Playgroud)
我得到的结果示例:
same_name
some_file
test_file
Run Code Online (Sandbox Code Playgroud)
预期结果:
./dir1/same_name
./dir1/some_file
./dir3/test_file
Run Code Online (Sandbox Code Playgroud)
这将是目录树的一个例子,但它可以更大更深
.
??? dir1
? ??? same_name
? ??? some_file
??? dir2
? ??? same_name
??? dir3
? ??? test_file
??? same_name
Run Code Online (Sandbox Code Playgroud)