Hot answers tagged command-line
3
You're looking at output redirection (Bash). By redirecting the regular output 'stdout' to filename, you're overwriting it. Error output, 'stderr' is still shown (in your terminal by default), though. That was the help text you saw.
To actually use the > character in grep as a character to match on, escape it in your shell (Bash), e.g.
grep -c \> ...
3
sudo -i
This command will let you land at the root shell.
More explanation and comparison between other solutions here
corrupted by user's
HOME=/root uses root's PATH env vars
sudo -i Y Y[2] N
sudo -s N Y[2] ...
2
You become root with sudo su (as an example). Or better said: you elevate your admin user to admin priviliges permanently until you exit. Example:
rinzwind@discworld:~$ sudo su
[sudo] password for rinzwind:
root@discworld:/home/rinzwind#
And no Ubuntu technically does not have an active root user. From the Ubuntu RootSudo wiki page:
In Linux (and ...
2
The previous answer is technically accurate, but I think is circumventing the user's overall knowledge of what they were trying to do. Let's focus on what you did wrong, and then rewrite the command so you can actually find the entries of ">" in the file instead.
(Explanation of why the file got dumped)
If you use > at the end of a line (try "ls > ...
2
After some of my own research, and some fiddling around, this is the solution I have found for myself:
grep security /etc/apt/sources.list > /tmp/su.list
apt-get -o Dir::Etc::Sourcelist=/tmp/su.list -q update
apt-get -o Dir::Etc::Sourcelist=/tmp/su.list -q upgrade -s 2>&1 | tee /tmp/security_updates_fetch.log
apt-get -o ...
1
You can do that with su or sudo, no need for both.
sudo -H -u otheruser bash -c 'echo "I am $USER, with uid $UID"'
The relevant parts of man sudo:
-H The -H (HOME) option requests that the security policy set
the HOME environment variable to the home directory of the
target user (root by default) as ...
1
I don't particularly care for that guide they give, you should not need Samba just to log in. Here is a somewhat better guide in my opinion.
Also, do note that when you log in, you will now have to log in as domain\username not just the username and you won't get a new log in screen just so you know. The log in screen will look exactly the same, this only ...
1
PiTiVi - allows users to easily edit audio/video projects based on the GStreamer framework. PiTIVi provides several ways of creating and modifying a timeline. Ranging from a simple synopsis view (a-la iMovie) to the full-blown editing view (aka Complex View) which puts you in complete control of your editing.
For install it from a terminal, use next ...
1
If it locks up completely, you can REISUB it, which is a safer alternative to just cold rebooting the computer.
REISUB by:
While holding Alt and the SysReq(Print Screen) keys, type R E I S U B.
R: Switch to XLATE mode
E: Send Terminate signal to all processes except for init
I: Send Kill signal to all processes except for init
S: Sync all mounted ...
1
If you use bash, you can add the following to your ~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
If you use zsh, you can add the following to your ~/.zshrc
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
1
This sounds like a trick for dd.
Do this :
sudo dd if=/dev/sda1 of=/dev/sdb1
dd (disk dump) is better for creating backups
The if options specifies what is to be copied and the of option specifies where it is to be copied.
1
Open Gnome Terminal
Click on Edit -> Profile Preferences
Go to Title and Command tab
Check Run a custom command instead of my shell
Set your Custom command to
/usr/bin/byobu
Full disclosure: I'm the author and maintainer of Byobu.
1
Why not
bzcat file | tee no_modifications | sed blah blah
?
This would decompress, tee (or split the data) into a file call no_modifications and stdout which you pipe into sed for "immediate use".
If you really want to delete the original then I'm afraid you're down to
bzcat file | tee no_modifications | sed blah blah && rm file
1
First, because you're about not to use terminal, I change sudo to gksu. And then, if you've created a script like this:
#!/bin/sh
gksu openvpn --config /home/ubuntu/Documents/vpnbook/vpnbook-euro2-udp25000.ovpn --auth-user-pass /home/ubuntu/Documents/vpnbook/password.txt
and named it your-script.sh, you can create a file like this (taken from this ...
1
add the complete path of phpunit to ~/.bash_profile like this
export PATH=$PATH:tools/phpunit/vendor/bin/phpunit
Thats it :)
Make sure that you are adding the complete path of phpunit. This is same as setting the environment variable PATH in Windows. $PATH will retain the values of PATH variable and we are just appending the location of phpunit to it.
1
I'm developing a cross-platform desktop application that lets you rename a set of files from a specified pattern to another one. User can specify both of the patterns.
You can download it from this link (it's called: file-renamer-swt). And here is the project main site.
1
I found the solution here: http://stackoverflow.com/questions/9652126/bashrc-profile-is-not-loaded-on-new-tmux-session-or-window-why and here: http://apple.stackexchange.com/questions/12993/why-doesnt-bashrc-run-automatically
I needed to add source ~/.bashrc to the end of my .bash_profile.
Only top voted, non community-wiki answers of a minimum length are eligible



