Tag Info

New answers tagged

0

Question 1 From the mount man page: Description All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the filesystem found on some device to the big file tree. Conversely, the umount(8) command will detach it ...


2

There is a "Reset" toolbar command to the right of compile. That will stop the running program in Dr. Java.


0

Solution found first must press CTRL+V and key in my case is F9 so i did CTRL+V F9 and return this ^[[20~ Now i know is key 20 and i bind it to tilde bind '"\e[20~":"~"' I try if work pressing F9 and return tilde I put this in $HOME/.profile for permanent change


1

Just redirect it. Take this script, for example which prints a line to stderr and one to stdout: #!/bin/sh echo stderr >&2 echo stdout If I now run that with nohup and redirect standard error to a file, it works as expected: $ nohup a.sh 2>er $ cat er nohup: ignoring input and appending output to ‘nohup.out’ stderr Note that it also includes ...


0

As nohup manual states: NAME nohup - run a command immune to hangups, with output to a non-tty It is used to run a command WITHOUT a tty asociated with it, you can end your session and the command will keep running, thus its output is not attached to a tty therefore not being able to show the output there. nohup creates a file named nohup.out though, ...


4

The "problem" is, that gpg writes directly to the TTY instead of STDOUT or STDERR. That means it cannot be redirected. You can either use the --batch option as daniel suggested, but as a more general approach you can use the script tool, which fakes a TTY. Any output is then sent to STDOUT, so you can redirect it to /dev/null: script -c 'echo ...


4

Add the --batch option. If you would like to achieve the same result through redirection you would have to close STDIN through: gpg … <&-


2

This has nothing to do with bash, it is purely an effect of the terminal's behavior, specifically scroll. When you reach the bottom of the screen, and start to type on the next line, the terminal creates a new blank line by pushing everything up one line. (In older terminals this destroys the top line. In newer terminals the top line is just pushed into the ...


0

You need to open it with java -jar Hello


1

You can copy the top line displayed in less to the X11 CLIPBOARD selection by typing with less: |.head -n1|xclip -sel c<Enter><Enter> That pipes the less buffer from the top line to the . mark (so in effect the whole screen content) to the head -n1|xclip -sel c command (to store the first line of that in the CLIPBOARD selection) You could ...


-2

it is as simple as typing "ls | pbcopy" (without quotes). The downside is you can not paste it into a terminal window, it thinks you want to press enter after each filename pasted. But you can paste them into a document.


0

arpspoof should normally be installed in /usr/sbin. You should check that your package did that as well, and if the file is executable: dpkg -L dsniff | fgrep arpspoof ls -l /usr/bin/arpspoof Then check that /usr/sbin is in your PATH: if [[ ":$PATH:" == *":/usr/sbin:"* ]]; then printf "path ok\n"; fi Most likely /usr/sbin is not in the PATH of your ...


0

Would the "-extent" parameter work here ? http://www.imagemagick.org/script/command-line-options.php#extent


1

Have you tried purging the package and then reinstalling it? apt-get purge terminator Then delete configuration files located in your home directory rm -rfvI /home/your_user_name/.config/terminator This should remove all the config files. Now reinstall. apt-get install terminator


0

I've found the solution by myself and I've written a script: from subprocess import call target = str(raw_input("Give me a site: => ")) call(["nslookup", target]) % target This is what I needed to know, thank you for your help


1

Add this to last line of your ~/.bashrc: unalias ls and type source ~/.bashrc


1

You have somehow got Windows style line endings, ie CRLF \x0D\xOA \r\n ... printf 'xyz\r\n' >file; cat file | awk '{print "a" $1 "b"}' outputs bxyz cat file | sed -n l outputs xyz\r$ - The $ inidcates end-of line You can filter out any extrandous \rs from a \r\n pair with awk cat file | awk -vRS='\r?\n' 1 | sed -n l Outputs xyz$ To ...


0

You have a carriage return in the new file (^M) instead of a linefeed (^J) at the end of the line. Try using cat -v new.file and also looking at the file using hd. You can remove the extraneous carriage returns using sed like this: sed 's/\r//' new.file


0

This is probably a new-line vs cariage-return issue. I think the new file only has the cariage-return ^M characters instead of newlines. Try file /path/to/new.file and see if it returns ASCII text, with CR line terminators In your case the a is printed followed by the input line which has the ^M line terminator, telling to go the beginning of the line and ...


0

For Reference, tasks like this will not need to be repeated, because once OpenDNS investigates the information you return, you won't need to do it again unless you need to report multiple domains. Your output will be similar to: Plain Lookup Using Your ISP's DNS $ sudo nslookup backpackerboard.co.nz Server: 66.90.132.162 Address: ...


1

tput tells you what the terminal advertises as its function keys. Terminals often don't advertise all the function keys and keychords that they support. To see what escape sequences the terminal actually sends, use the Ctrl+V method mentioned in that same answer: press Ctrl+V in a terminal application that doesn't rebind the Ctrl+V key (such as the shell). ...


1

Add your command to ~/.bashrc.


2

With zsh, if you want to disable tty device local echo for a specific command, you can do: STTY=-echo a-specific-command zsh will apply the specific settings (by calling stty) and restore them when the command terminates. Of course, you'll probably only want to do that for applications that don't read from the tty device.


0

Building on what Interesting... said, you could always just delete the devish folder (/devish) by running sudo rm -rf /devish and then entering your password at the prompt. That is the messy way of permanently deleting DEVISH. There is a cleaner way using the program (included with DEVISH) devb. To do this run devb -r which will remove DEVISH and all of its ...


1

That output looks a lot like something called alias with fewer parameters than intended. Try running echo | $SHELL -ix | grep alias to find whatever is printing the annoying line, then grep for that in your home directory, /etc, perhaps /usr/share, and wherever else you might have put something that influences your shell. (As for that command: -x prints ...


0

Well, a sample .devishrc would look something like this: #!/bin/bash #file:".devishrc" # Ran by .bashrc, variables are interpreted by .devishrcint export func="true" export hitch="/devish/info" export start="" #does nothing I can see your confusion, changing /devish/info to whatever hitch you want it to be, and it throwing out errors every ...


2

Your second problem seems to be an issue with tmux and the evaluation of certain AppleScripts through osascript. There's a wrapper you can install which should fix the problem. You'll want to install reattach-to-user-namespace through Homebrew or MacPorts and wrap the call to osascript: reattach-to-user-namespace osascript -e 'display notification "Hello, ...


2

It seems like the -o flag will take the actual column name. So if the top command shows only "mem" then the command should be "top -o mem". For the ubuntu machine I am testing with, the column is called "%MEM". On the OSX Yosemite I tried, it is "mem".


1

I am reading this tutorial, and trying to create a new user with root privileges and then block root access via ssh in a CentOS 7 server. The problem is that the new user is blocked from doing root actions like nano /etc/sudoers. Also, I seem unable to remove the block of root login. So my pre-existing open root session is the only access I have to root ...


2

It depends on your terminal. If this is something important to you, you could consider Emacs term-mode which gives you the full text-manipulation capability of the editing environment. It's possible that you consider that to be overkill, of course!


4

If you use Urxvt, you can extend the keyboard functionality of the terminal using urxvt-perls, a collection of scripts that enables: selecting text passing URLs to your $browser searching your scrollback and yanking and pasting to and from your clipboard Essentially, with urxvt-perls installed, you can dispense with your mouse entirely.


4

People usually want to see what they're typing (unless it's a password) :-) The terminal accepts input at any time, and buffers it until an application reads it. More than that, when the tty is in cooked mode, the kernel buffers whole lines at a time and provides some rudimentary line editing functionality that allow you to kill the entire buffered line ...


0

Use RXVT in daemon mode, and use the tabbed extension for urxvt. Execute urxvtd when you start your session, and spawn new windows with urxvtc. Each window takes only around 1-10M additional memory.


1

Re: "You could simply explain what that command, is, what it does and what else you can do with it and whoooosh, it would be a better answer. – Bobby" The Unix name of the current terminal (or console, as we oldsters use to sometimes also call it) is: /dev/tty which, can be used to easily create a new multi-line file from the command prompt thusly: cp ...


2

I wrote a little C program to print three lines of bricks across the terminal for this purpose. Not empty space, but it helps give visual separation in the same way, and stands out in verbose output that might have a bunch of vertical space. Swap out your favorite character to taste: #include <termios.h> #include <sys/ioctl.h> #include ...


0

Just clear twice! Example: clear; clear; echo "Hello World"


0

This is sort of a sideways answer to your question, but I prefer using an inverted prompt (which stands out and is easy to spot) for just the purpose of quickly being able to determine where in the scrollback the last command was run. You can invert your prompt's color (i.e. black text on white background) by adding the ANSI sequences <esc>[7m ...


4

As mikeserv explains, POSIX doesn't specify tput cup. POSIX does specify tput but only minimally. That said, tput cup is widely supported! The standardised way of positioning the cursor is using ANSI escape sequences. To position the cursor you'd use something like printf "\33[%d;%dH%s" "$Y" "$X" "$CHAR" which will print $CHAR at line $Y and column $X. A ...


1

Try to run gnome-terminal -x sh or gnome-terminal -e bash (from xterm or directly as command by Alt+F2) and you will get gnome-terminal with sh/bash. Then after Go to: Profiles > Profile Preferences > Command > Custom command (where you've set export TERM=xterm-256color) and make correction Hope this helps.


1

Another approach could be to have some unique text in your prompt (I use $ followed by a non-breaking space (PS1=$'$\ua0')). And configure your terminal emulator to scroll-back to it upon some key press. For instance, with GNU screen, in ~/.screenrc: defscrollback 5000 bindkey \033` eval copy "stuff k?$\240\r" Would map that to Alt+Backtick


1

You can use clear multiple times (clear;clear) or just hold down Ctrl+L until you satisfy! With zsh, you can try (fun with repeat):- repeat 5 clear repeat 20 echo repeat 50 printf '\n' And of-course you may want to alias goaway='repeat 7 clear'.


1

I trust you already have enough ways to abbreviate echo -e "\n\n\n\n\n\n", so I won't add to that. But you have another option: Many terminal emulators support searching, so you can go to the start of the last command by searching backwards for some part of your prompt. (Or for some known string in the output, but the prompt is always there.) TBH I usually ...


2

There are a few options that spring to mind Spacer lines: sl() { yes '' | head -"${1:-5}"; } # Use as "sl 10" or "sl" Pipe the output of your make through a pager: make {whatever} 2>&1 | less Run the entire session under screen. You can then Ctrl AEsc and scroll up through the buffer a page at a time using Ctrl B. Use ReturnReturn to exit ...


0

bash script to print a custom number of newlines: #!/bin/bash if [[ "$1" =~ ^[0-9]+$ ]] then for ((i=0; i<$1; i++)) do echo done exit 0 fi exit 1 Name it (say script.bash) and put it in your $PATH (say in /usr/bin), run chmod +x /usr/bin/script.bash and call it with script.bash <number_of_lines>, or put it wherever you ...


1

About CJK input without X. You must first enable the display of multi-byte characters on the console. Maybe it would be possible in fbterm. To I guess(I do not have the experience of Chinese input), Chinese input might be possible in the uim + uim-fep + uim-chewing. Alternatively, you can use the extension of the editor (emacs, vim).


1

I have alias five='echo -e "\n\n\n\n"' for that, you can further shorten the alias to your liking of course.


2

As i mentioned in the comments normaly you can easily select the text to copy the text and paste it with the third mouse button. The third button is the middle button, if you have no middle button use both buttons. But if you wish to use the shortcuts and you use xterm with awesome, than you can adjust your .Xresource file in your home directory. Add this ...


1

I can answer part of my own question: Yes, one can start X from within the chroot'ed environment. I just found the following gentoo wiki page: http://www.gentoo-wiki.info/HOWTO_startx_in_a_chroot So now I know it's theoretically possible. So if I manage to run KDE from the chroot'ed system, I'd be able to test Chinese input further... Also, this answer ...


2

users counts login sessions. From sudo: The su command is used to become another user during a login session. (Emphasis is mine.) A login session creates a new tty, where as su uses the existing tty. I just looked at the source code to the users command. What it does is read utmp. So I guess the bottom line is that if you write a program and write ...


4

As explained in man ssh: -t         Force pseudo-tty allocation. This can be used to execute arbi‐           trary screen-based programs on a remote machine, which can be           very ...



Top 50 recent answers are included