Tag Info

Hot answers tagged

8

I think this should do it: tar -xzf file.tar.gz -C ~/locationX folder1 -C ~/locationY folder2 The -C option means to change to the specified directory before doing the extraction. Specifying filename arguments after the tarfile name restricts the extraction to just those files or directories. And you can repeat this -Changing directories as you do. Note ...


4

read -s disables the terminal echo only for the duration of that read command. So if you type something in between two read commands, the terminal driver will echo it back. You should disable echo and then call read in your loop without -s: if [ -t 0 ]; then saved=$(stty -g) stty -echo fi while read -rN1; do ... done if [ -t 0 ]; then stty "$saved" ...


4

Ony my Linux systems, man 1 man mentions the MANWIDTH environment variable, which, now that I look it up, is also specified in the FreeBSD man(1) manpage: MANWIDTH If set to a numeric value, used as the width manpages should be displayed. Otherwise, if set to a special value ``tty'', and output is to a terminal, the pages may ...


3

You can start the process in screen, type screen (it will start new screen session), run any command just like in your regular shell, detach screen (by pressing Ctrla, then d) and attach to the screen from any other terminal tab by typing screen -r. In this case the process's parent is screen, which is detachable / attachable from any terminal session, ...


3

echo is a setting of the terminal device (the discipline part in the tty kernel driver), termcap is about controlling the terminal (real or emulator) via escape sequences, it's two separate things. Here you want to prevent the application to do a specific ioctl. One way could be by detaching it from the terminal. socat - exec:okular,pty,raw Would run ...


2

The command line option -o (o standing for "Override-sort-field") also works on my Xubuntu machine and according to the Mac man page of top it shoult work on a Macintosh too. If I want to short by memory usage I usually use top -o %MEM which shorts by the column %MEM. But I can use VIRT, RES or SHR too. On a Macintosh I would probably use mem or vsize. I ...


2

The problem is: When bash is started non-interactively then it does not read ~/.bashrc. Thus you have to read h() from the script. If you want to use aliases in a script then you have to enable the use of aliases in the script with shopt -s expand_aliases define the alias in the script. An alternative to an alias is defining a shell function (which ...


1

Detach from currently attached session Session Ctrl+ b d or Ctrl+ b :detach Screen Ctrl+ a Ctrl+ d or Ctrl+ a :detach


1

There is a split command: ~$ split --help Usage: split [OPTION]... [INPUT [PREFIX]] Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input. ... -n, --number=CHUNKS generate CHUNKS output files. ... CHUNKS may be: N split into N ...


1

Jobs are a shell concept. A job is a subprocessĀ¹ of a shell that the shell tracks. A shell instance running on one terminal doesn't know anything about the jobs of another shell instance. When you run jobs in the shell running in the second tab of your terminal emulator, this lists the jobs in that shell. The shell running in the second tab doesn't know ...


1

As pointed out in this Ask Ubuntu answer, you may use zssh instead of ssh. When using zssh, you'll be able to switch to file transfer mode using Ctrl + @. This should allow you to transfer files back and forth between the local and remote ends of your active connection. Another trick pointed out in that answer is to send ssh to the background while you call ...


1

The supported terminal capability depends on your terminal emulator (xterm, ...). The terminal emulator should set the term info correctly. It does usually not make much sense to use "another terminal" (except maybe xterm-256color instead of xterm or if the $TERM variable is set wrongly). You should use libraries like ncurses which deals automatically with ...


1

I think the option of enabling "Ctrl+V" varies from emulator to emulator, but there are easy ways around this most of the time: Ctrl + Shift + V works as a paste in most terminal emulators I've used. Your mileage may vary, so you can check if your emulator has a similar keyboard shortcut (usually an afterthought in gray font after opening the menu "Edit > ...


1

Not exactly the answer you asked for, but you should be able to transfer files through an SSH connection: sending ssh user1@firewall "ssh user2@cluster \"cat > remote_file\" " < local_file fetching ssh user1@firewall "ssh user2@cluster \"cat remote_file\" " > local_file EDIT: There are also terminal based file transfer tools like ...


1

After a day of struggling I finally ended up with even better thing I needed: #!/bin/bash # Adds RVM to needed paths to start servers with needed Ruby version PATH=$PATH:$HOME/.rvm/bin [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # I need this server to run in background startLocalRedmineServer()( cd ...


1

There is no foolproof way. TERM uses the same value for mostly-compatible emulators; most modern terminal emulators aside from screen and tmux report xterm. You can explore the process list to find Vim's parent's parent. That will tell you in what terminal emulator (if any) Vim is running in in the common case where Vim was launched from a shell which was ...


1

If you have GNU stdbuf, you can use: $ stdbuf -o0 -e0 php -S 0.0.0.0:12345 | tee -a access.log PHP 5.4.34-0+deb7u1 Development Server started at Mon Nov 24 14:38:33 2014 Listening on http://0.0.0.0:12345 Document root is /home/cuonglm Press Ctrl-C to quit.


1

What you describe as your "actual" IP address isn't, it is the IP address of your router, or anything else that got an IP address from your provider and acts as an intermediary for your computer to the internet. That is why your (windows) hosts provides an internal address as well. Your VirtualBox host gives out IP addresses in the range 10.x.x.x by default ...


1

I had the same issue after a fresh install of arch. I checked, double checked and triple checked the locale.gen and even removed every locale except en_US.UTF-8. I was just about to give up when I checked under settings, Regions & Language and discovered the language was not set even though I had run the command to set it. After picking english and ...


1

A Linux machine (running with SystemV) defines a special file, /etc/inittab that declares (but not only) how many *getty processes will run and their corresponding terminals. E.g. this is an excerpt of inittab on my Gentoo Linux machine: # TERMINALS c1:12345:respawn:/sbin/agetty --noclear 38400 tty1 linux c2:2345:respawn:/sbin/agetty 38400 tty2 linux ...



Only top voted, non community-wiki answers of a minimum length are eligible