(学习 bash)我试图检查 bash 版本,所以我输入了/bin/bash -v.
这会向屏幕输出大量文本(.bashrc 的内容以及源自它的其他文件)。
由于该命令,我是否可以搞砸一些事情(例如覆盖一些配置文件/设置不正确的环境变量等)?
我也找不到有关-v开关用途的文档。
我错误地输入cd //而不是cd /. 令我惊讶的是,当前目录显示为//.
那个目录是什么?它为什么存在?
apple@snipped $ pwd
/home/apple
apple@snipped $ cd /
apple@snipped $ pwd
/
apple@snipped $ cd //
apple@snipped $ pwd
//
apple@snipped $ cd ///
apple@snipped $ pwd
/
Run Code Online (Sandbox Code Playgroud) 当我输入时,man bash它会显示终端本身的信息。
我如何告诉“ man”在 gedit 中打开信息?这可能吗?
我的目标是将脚本的所有输出记录到脚本要创建的目录中。
例如,我有:
~/.abc.sh:
#! /bin/bash
rails new myapp
Run Code Online (Sandbox Code Playgroud)
当我跑...
cd ~/code
. ~/.abc.sh
Run Code Online (Sandbox Code Playgroud)
...这将在目录中创建一个新的 Rails 应用程序~/code/myapp。
当 Rails 创建应用程序时,它会输出大量文本,我想捕获这些文本并将其存储在与rails新创建的命令相同的目录中的日志文件中。我也想在终端中显示该文本。
我该怎么做?
这是我有一个简单的场景:
我如何ls从终端获取相同的文件夹(显示在 Nautilus 中)?(mount并且ls /mnt不要列出那些 Windows 共享)
附言。我在做什么的详细信息:
我正在尝试创建一个目录并cd进入其中:
function abc() {
appname=$1
appdir="$HOME/code/$appname"
if [ mkdir $appdir -a cd $appdir ]; then
echo Success
else
echo Failed to create and switch directory
fi
}
Run Code Online (Sandbox Code Playgroud)
当我重新加载 bashrc ( . ~/.bashrc) 时,出现错误:
bash: [: too many arguments
Failed to create and switch directory
Run Code Online (Sandbox Code Playgroud)
我该如何解决?又是什么[:错误是什么意思?
附言。有人可以指导我阅读“非神秘”的 bash 脚本教程吗?
我如何告诉man我显示我的 Ubuntu 10.10 系统上安装的所有“手册”的列表?
另外,是否有安装手册页的特定目录?
什么是谈论 Ubuntu 或 Linux 一般用法的最新好书(但这也适用于 Ubuntu)?像:
我想我想找到一些可以作为理解 Linux 系统/环境的良好起点的书。
是否可以在 Windows 上安装实际的 MySQL 数据库并从本地网络上的 Ubuntu 10.10 访问它?
我想我需要一个 MySQL“客户端”?所以我看了这里 (MySQL Linux0Generic),但我不知道要下载什么..
附言。我尝试在MySQL 站点上查找文档,但看不到任何类型文档的链接...
我在 VirtualBox 中使用 Ubuntu Server 10.10。我需要在其上安装一个 GUI 程序 (RubyMine)。
我检查了安装ubuntu-desktop使用apt-get,并要我安装430个新软件包(包括OpenOffice的)。我首先安装了服务器,以保持安装尽可能干净!
如何进行最小安装(需要所有软件包)来运行该单个 GUI 程序?
我创建了一个文件/etc/apt/apt.conf并添加了以下内容:
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Run Code Online (Sandbox Code Playgroud)
但sudo apt-get install ubuntu-desktop还是说:
0 upgraded, 430 newly installed, 1 to remove and 9 not upgraded.
Need to get 155MB of archives.
After this operation, 542MB of additional disk space will be used.
Do you want to continue [Y/n]? n
Run Code Online (Sandbox Code Playgroud) bash ×3
manpage ×2
windows ×2
bashrc ×1
command-line ×1
file-sharing ×1
filesystem ×1
gedit ×1
mysql ×1
redirect ×1
scripts ×1
server ×1
virtualbox ×1