Tag Info

New answers tagged

0

ttysnoop is what you're looking for. It's been years since I've used it, so I'm not sure it works on modern kernels. You'll have to do some research to get it working. But if you do, please let me know.


0

This problem has a relatively simple solution, that I totally overlooked. The folders are all name sensitive. My theory is every folder/app under your cd ~/ area uses that name in it's coding somewhere. By renaming just that in terminal, you confuse the other programs because they look for your normal folder. The only way to change it is to do it apples way, ...


0

This works (kinda) for me: tty=pts/0 sudo peekfd -8cnd $(ps -fat | grep "$tty *Ss" | awk '{print$1}') 0 1 2 Replace pts/0 with the TTY of the user you want to watch. This will NOT work perfectly for everything, but it works with most input/output.


1

For Ubuntu 14.04, Ignacio's answer doesn't work. In fact is at other location, as told here.


0

Well I was able to find a really simple answer. I downloaded Ubuntu and installed it alongside Kali. Ubuntu installed a bootloader that also read Kali and I can dual boot between them. Bye bye Windows :P


1

localhost is normally defined in the /etc/hosts file, not in DNS (although your DNS has an emergency backup entry for it). Here's the normal contents of /etc/hosts in OS X (as of Mavericks): ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost ...


1

If you want to search from the command line and jump to a user-definable browser for results, another solution is use surfraw. Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many ...


1

Customizing terminal colors via Tweaks/Dconf globally changes the colors of all terminal application. For example mc is completely unusable with the preinstalled terminal themes (at least for me). It's extremely difficult for me to differentiate between a command prompt and other text. In this case, you should take a look your ~/.bashrc file and try ...


0

Everything assuming Kali is installed to /dev/sda1, your first and only partition, and the whole system boots from disk containing that partition (/dev/sda). Just to be sure: /dev/sda -> first disk, /dev/sdb -> second, etc. /dev/sda1 - > first partition on first disk, /dev/sda2 -> second partition on first disk, etc. You can't boot from HDD. Well, boot ...


0

I use and recommend iTerm2 iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with OS 10.5 (Leopard) or newer. Its focus is on performance, internationalization, and supporting innovative features that make your life better.


0

You will need to install Vim Solarized, in this repository they have the instructions. Move solarized.vim to your .vim/colors directory. After downloading the vim script or package: $ cd vim-colors-solarized/colors $ mv solarized.vim ~/.vim/colors/ Modify ~/.vimrc syntax enable set background=dark colorscheme solarized Basically you need to ...


1

You can check with ping if your machine comes up and then fire off one or several ssh commands. Note that you will need to setup certificate-based authentication on your host. Here's a little script based on GNU/Linux' BASH but I guess you can convert it to whatever Mac OS X is using. #/bin/bash hostup=0 while [ $hostup -ne 1 ]; do ping -c 4 ...


0

If you have sudo properly configured, this is proper way to create that directory: sudo mkdir u01 If sudo does not work for some reason (or not even installed - unlikely, but possible), you can use su with command parameter -c, like this: su -c "mkdir u01" (note that command must be quoted to be passed properly to su). Important difference between ...


0

"if you try to run x86 executables on an ARM CPU, this message comes up." you can see your system info by typing uname -a !


2

You can use fold to first wrap the text, then pipe to less: fold -w 78 | less Of course, -w sets the number of characters. By default it's 80. fold is POSIX and bundled with OS X. Apparently, using less -r as the default Git pager will also achieve folding of long lines. Otherwise, while the diff is being displayed, you can type -S, then Enter to ...


0

You can't undo, but you can find out the files extracted a few minutes or hours ago. As you are using Ubuntu system, you can use the find command filtering out the files with the ctime or cmin. find /PATH/TO/THE/DIRECTORY/ -cmin -30 Where /PATH/TO/THE/DIRECTORY/ should be replaced by the path to your directory which contains the files you extracted. So ...


3

The problem is your call to su. The correct syntax for executing a command as another user is: su [username] -c "[command]" Note the quotes around the command; its important to keep the other arguments to the command get executed properly.


0

Overall, a "normal" user shouldn't be allowed to create files or folders in the root of the filesystem. Allowing it leads to all manner of security issues. When you run "su root mkdir u01", your system is asking you for the root password. What you probably should be running is "sudo mkdir u01" which will ask you for your normal user password. Note that ...


0

Press your prefix (e.g. Ctrl+A or B, which is the default) and then : and type kill-session, then hit Enter. This will, as the name of the command suggests, kill the session.


1

Terminator's configuration (including buffer size), is stored in its configuration file, usually found at ~/.config/terminator/config. You may configure the buffer size by modifying the configuration file to include the following. Be sure to include the section headings, as these are necessary. [profiles] [[default]] scrollback_lines = 5000 ...


0

The directory in question turned out to be: /usr/share/terminfo/ Related reading I found informative: http://unix.stackexchange.com/questions/111746/why-do-we-need-so-many-terminal-emulator-packages-and-what-is-their-use http://unix.stackexchange.com/questions/108410/is-it-correct-to-set-the-term-variable-manually


0

Are you sure your local Mac is reachable at that IP address, from the remote machine? For example, if you had an RFC 1918 private address such as 192.168.x.y on your local Mac because it was behind a NAT gateway, and the remote machine was on the public side of the NAT gateway, then the remote machine wouldn't be able to reach your local Mac at that address, ...


3

Do I understand correctly that you're using SSH to connect to the remote host, then you're running scp on the remote host to copy the file back to the local host? Without knowing anything about these two hosts, it's perfectly possible that your local host can make SSH connections to the remote, but the remote can't make SSH connections to the local. If you ...


3

Here are a few common keyboard combinations that many Mac and Linux programs use (not sure which are followed by most Windows apps, though): CTRL-A - Bring the cursor to the beginning of the current line CTRL-E - Bring the cursor to the end of the current line CTRL-Left - Move the cursor back one word CTRL-Right - Move the cursor forward one word


1

chsh -s /bin/bash should do the trick.


7

Simply use UP and CTRL-A. Both !sudo and sudo !! function easy. With a difference: sudo !! will execute the last command taken from the history with sudo in the beginning. !sudo will execute the last command in the history that started with sudo. Usually CTRL-A brings you at the beginning of the line in a linux terminal and CTRL-E to the end. If ...


2

@WChargin is correct regarding !sudo, so I'm changing my answer... sudo !! is the correct answer, as many have said. Just in case, I'm pasting here the following, in regards to the history command, and how that ! command works. I hope this helps. The history command The history command can be used to list Bash's log of the commands you have ...


4

Use sudo !! The !! will be replaced by the complete previous command.


0

On some routers, there is an option to view clients connected to the router, and it may display the addresses. I've got a Linksys EA2700 that does this, under DHCP Client Table. This may vary from router to router of course, but a viable option.


0

You could use nmap to do a scan of the network. nmap -sn 192.168.0.0/24 <-- replace the subnet with your own. You can get nmap from here Alternatively, a GUI tool is fing which can be grabbed from here Does much the same job - however apparently only works for Snow Leopard, Lion, and Mountain Lion.


0

The man page mentions this: The pid field displays the following for the architecture: + for 64-bit native architecture, or - for 32-bit native architecture, or * for a non-native architecture. That doesn't match my experience of seeing a - on some, and nothing on the rest. Perhaps no flag at all means "the default architecture."


0

You can add as the very last line of your script a wait PID instruction with the PID of the background command you are interested it will finish. Of course you have to store that PID in your script. #!/bin/bash # do first stuff... select blah in foo bar oof rab do cmd $blah & PID_TO_WAIT_FOR=$! # here you store the PID of the last command break ...


0

As mentioned in comment, ConEmu has Inside ability. And it can sync folder! Look at "Sync" column in the status bar (it may be disabled by default). As for view representation of explorer window - that is the issue to your "browser". You may even create small wrapper around ConEmu if you know C#/Basic/C++... At last, if you drag&drop some file from ...


0

One way to do it would be to alias the python command to use anaconda rather than changing your path. Instead of changing your path, try adding: alias python="/opt/anaconda" to your .bashrc file. This should make it so anaconda will only be run when you type "python" into the terminal, not when something else tries to use it. (somebody correct me if I'm ...


1

If you're searching binary files, then you must use grep because ack will ignore them, always. When searching through a few large files, grep will be faster than ack. It sounds like you're trying to decide if you should abandon grep and use ack all the time, and I suggest that you should not. You should use both grep and ack when it's appropriate. ...


1

You should have a look at the man page and it will tell you: WHEN TO USE GREP ack-grep trumps grep as an everyday tool 99% of the time, but don't throw grep away, because there are times you'll still need it. E.g., searching through huge files looking for regexes that can be expressed with grep syntax should be quicker with grep. If your ...


0

ack is not part of default installation on all Linux/Unix server but grep is. Have you tried the_silver_searcher or the_platinum_searcher. They both run faster than ack


1

Will it suit you if you run it in a new xterm session and then exit from your current terminal? It should leave the new one still working. xterm -e "bash -c \"./script.sh; exec bash\"" & EDIT: The approach bellow allows you to run script from GUI in terminal, select command to run, leave terminal and have command still working. As an example I put ...


1

I agree with romainl's answer, but to directly answer your question, try this: if getcwd() == $HOME cd data endif


0

I have a hard time imagining a good reason for changing the location of your $HOME directory or even why you'd think it could work without issues. If you want to open Vim in a specific directory, cd to that directory first and start Vim from there. If that's still too much work, use an alias that does that for you. If you want your terminal to start in a ...


0

A while ago I have written a script to wait for the end of another process. NOISE_CMD could be something like notify-send ..., given that DISPLAY is set correctly. #!/bin/bash NOISE_CMD="/usr/bin/mplayer -really-quiet $HOME/sfx/alarm-clock.mp3" function usage() { echo "Usage: $(basename "$0") [ PROCESS_NAME [ PGREP_ARGS... ] ]" echo "Helpful ...


0

This means that you have some incorrect sed commands in one of your shell's initalization files. Since you're using bash and OSX, this will be one of ~/.profile,~/.bash_profile,/etc/profile, /etc/environment (though the latter is extremely unlikely). To find out which one, run grep system_type ~/.profile ~/.bash_profile /etc/profile /etc/environment ...


1

Check the .bash_profile file in your home directory. The commands in this file are read whenever a terminal starts. The offending sed commands should be found in that file, if not then check /etc/profile forsed` commands.


0

.profile will affect all shells for that user .bashrc and .bash_profile will affect bash shells Similarly, .csh_profile would affect csh shells, and so on You can also use /etc/profile to apply changes for all users.


0

Delete the font cache at C:\Windows\system32\fntcache.dat. This should fix your problem


1

My problem was mainly that MacVim opened, read, and wrote especially slowly (sometimes upward of 15 seconds). mvim --startuptime revealed that sourcing files from .vimrc and the runtime/ directory was taking most of the time, and the problem was solved by adding the line: set rtp+=/usr/local/Cellar/macvim/7.4-73/MacVim.app/Contents/Resources/vim As you ...


2

$TERM is special – it is not sent as an environment variable (which wouldn't make sense for non-Unix systems anyway), but rather as a special "terminal type" field when establishing a pseudo-terminal channel, per RFC 4254 ยง 6.2. 6.2. Requesting a Pseudo-Terminal A pseudo-terminal can be allocated for the session by sending the following ...


1

$TERM is set by the terminal, that is, the parent process of the shell you are running locally. It is used by applications to determine what the capabilities of the terminal is, for example whether it supports colour. It's very useful to forward this to any other hosts you connect to, since otherwise they would lose this knowledge of the capabilities about ...


3

You could put this line earlier on in your script: exec 3>&1 Then whenever you need to send something to go to stdout: echo "this goes to stdout" 1>&3 Cleanup: exec 1>&3 echo "now goes to normal stdout" exec 3>&- #to remove fd3 How it works is that you define a new file descriptor, 3, and it points to the same place ...


-1

I have tried su many times but I found sudo to be easier. You can try sudo -u <username>



Top 50 recent answers are included