Tag Info

New answers tagged

1

/etc/profile is not evaluated when you run sudo ... as far as I know and the problem with the symbolic link is the mvim script; if you look at it, it has these lines: # GUI mode, implies forking case "$name" in m*|g*|rm*|rg*) gui=true ;; esac Since you started it with sudo vi the name does not fullfil the criteria to launch in GUI mode. You could simply ...


0

Install xf86-input-keyboard if you don't have it. Set kbd_mode -u Make sure you don't have multiple instances of the KB (check what XINPUT: reports).


0

To turn Scroll Lock led on run: xset -led 2 led on To turn it off run: xset -led 2 led off


0

Avoid the problem with using -p in (some versions of) ssh-copy-id by adding the host to your ~/.ssh_config (where you will probably want it long-term anyway): Host ****@****.com Port *** Now run ssh-copy-id without the -pargument: $ ssh-copy-id ****@****.com


2

Instead of -x "Icon" use -x "*Icon*"


2

This function should looks like: callSINGULAR() { /opt/local/bin/Singular -b "$1" } Because the parameter is first, provided to function


0

Running in a Linux console (no X), setting TERM to xterm (any flavor) or rxvt (any flavor) will not give good results. The linux terminal description is the most often used. Compare those with infocmp, e.g., infocmp xterm linux and you will see a number of differences. One aspect of the "bright colors" is not apparent in the terminal description: the ...


1

I was looking for the same and shortly after reading this question I found the solution for my setup (Debian 8, Gnome-Flashback): The relevant key is in org.gnome.desktop.wm.preferences, "button-layout". Edited with dconf-editor from "appmenu:close" to "appmenu:minimize,maximize,close" and the buttons are back :-) Regards, Joachim


1

Thanks to @rickfillion: ssh -t me@server.com "cd sub/folders/; bash -l"


0

You can make an emacs editing macro ("editing macros" are what the name "emacs" is derived from) and in the keyboard macro put commands that run Gnu Bash scripts or other shell programs and create scripts that query the user for Y or N answers. So to create the macro, you'd do something like this: Cx ( Mx new-frame return Mx shell return (or just Mx eshell ...


0

ssh user@ip cd /path/to/dir SHOULD do it fine OR set it in the ssh_config file for that connection even:


0

Turning off meta mode is part of the answer. xterm has more than one configurable feature related to this. The ncurses FAQ Alt-keys do not work in bash provides some of the background. Essentially, there are two notions of what meta mode is: xterm and the terminal database (terminfo) document the use of a meta key as a sort of shift-modifier, setting ...


0

To show all of the capabilities of a terminal using ncurses, you need different options than were suggested earlier. The -L and -1 options show long names and a single column, respectively. Since release 5.0 in 1999, ncurses has supported user-definable (extended) capabilities which may be compiled into a terminfo entry if the tic -x option is given. ...


0

The problem was Terminator in my case, I tried to remove it and the option started to work again. * palmface *


3

You probably have a .png file in your current directory and the * is expanded by your shell. Here's a practical explanation. Create a directory called test, then another one called sub inside it and finally a file called myfile.txt in sub. Then cd into test. Here are commands to do that: ~ >mkdir -p test/sub ~ >touch test/sub/myfile.txt ~ >cd test ...


0

Do you use vi (or vim)?  If you do, then, since you've already got the JPEG file names in a text file, the easiest way may be to edit that file with vi / vim and type :%s/\.jpg$// which says, on every line in the file, look for .jpg occurring at the end of a line, remove it, and replace it with nothing.  If there are some lines that don't end with .jpg, ...


1

Borrowed from Stackoverflow: ls -1 | sed -e 's/\..*$//' I tried flagging as duplicate but didn't work. One of my own solutions given we know the file extension(s). find -type f -exec basename -s '.jpg' "{}" \; So find all files as opposed to directories - type f and then execute basename for each. The -s allows you to specify a known suffix to ...


0

If you have your list of files in the file "in.txt", run this script to get the list of files without the extension in "out.txt" : #!/bin/bash while read fullfile; do filename=$(basename "$fullfile") filename="${filename%.*}" echo $filename >> out.txt done <in.txt


1

Short answer: M-x terminal-emulator sounds exactly like what you're asking for. What you need might be different - if you really just need to give the program a series of y lines on stdin, consider yes | program. If the program really wants its stdin to be a tty, consider using expect.


0

There is a Windows software for accessing Amazon Cloud Drive from Windows Explorer as a drive, NetDrive. But There is no Linux version.


2

Are you looking for the .../folder/subfolder/ folder itself, all files in it, or some specific file in it? For the folder itself: find / -path "*/folder/subfolder" -type d For all files in it: find / -path "*/folder/subfolder/*" For a specific file directly in the folder: find / -path "*/folder/subfolder/filename" For a specific file somewhere under ...


0

I'd use find with grep: find | grep -i "\/folder\/subfolder\/"


0

Try find / -name "*/?older/?ubfolder/*" -print That would, starting from the root, output every file that contained /folder/subfolder/ in its path. Note the '?' marks are to compensate for case-sensitivity.


1

You have different possiblities: If your program is already running Press CTRL+Z to suspend your program. It will not be running now. To resume the program in the background, type bg and press ENTER. If you want to start a new program in the background directly Simply add & to your program before you start it: $ geany "do_while.cpp" & You might ...


0

Put export CLICOLOR=1 export LS_COLORS='di=34:fi=0:ln=36:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90' into you ~/.bash_profile (~/.bashrc works as well but is for non interactive shells). Create the file if it does not exist.


-1

Just use the command: numlockx on or numlockx off to change the state.


1

To keep the terminal opened until a key is pressed: gnome-terminal -x bash -c "ls && read" To keep the terminal opened until exit: gnome-terminal -x bash -c "ls && bash" Replace ls with the command you want to execute (your compiled executable file).


0

I can't be sure 100% since I'm on a Mac without a Gnome setup, but this should work: add ; read to your command to be executed, so after executing the command you need to press Enter before closing the window: cmd = 'gnome-terminal --command="./myprog ; read"' subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) I tested this with xterm instead ...


0

Since you start it with Python try this: import time #Your Code here time.sleep(5) # delay for 5 seconds


1

how can i write the line that contains such character and also the previous line Use -B1. For example: $ seq 10 >file $ grep -B1 5 file 4 5 If you want to include the file's name, that add -H: $ grep -HB1 5 file file-4 file:5 Combined with find Assuming that you have either GNU find or a modern BSD find, then your complete command can be ...


1

There are several comments in the terminal database about "+" used as a convention for building blocks. For example: # The descriptions with plus signs (+) are building blocks. and is noted in the header of the database: # Entries with embedded plus signs are designed to be included through use/tc # capabilities, not used as standalone entries. The ...


0

I've found terminal WILL ask: Do you really want to turn remote login off? If you do, you will lose this connection and can only turn it back on locally at the server (yes/no)? Typing 'yes' in scripts is not always possible. To resolve this, use a -f flag before -setremotelogin, like so: systemsetup -f -setremotelogin on systemsetup -f -setremotelogin off ...


0

Lines 5 and 7 are both bad and should be deleted commented out until/unless somebody can figure out what they are supposed to be. Line 5: /Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Nessus/run/sbin:/opt/X11/bin:/usr/local/bin:/usr/local/sbin simply expresses the value of $PATH as if it were ...


0

This line has an extra single quote at the end. Take that off and try to source the file again. source ~/.bash_profile. PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Nessus/run/sbin:/opt/X11/bin"'


0

Fedora configures ls to use entries of the 256-color palette if your $TERM is set accordingly; see your $LS_COLORS variable and the /etc/DIR_COLORS* files. On gnome-terminal's UI you can only configure the first 16 of these. That is, probably the blue and green colors your ls produces are simply not the "standard" blue/green colors, but one of the ...


3

When you run find / -name VISA, the / always refer to the root directory of your Mac and not the external drive because it's an absolute path. It's the same on any UNIX-Based system. What you want, is to specify the folder where OSX has mounted your drive: find /Volumes/ASTUTE -name VISA And since you only want to search for folder you can use the -type ...


0

See the open manpage : --args All remaining arguments are passed to the opened application in the argv parameter to main(). These arguments are not opened or interpreted by the open tool. So, your command would look like: open -a /Applications/Beyond\ Compare.app "$6" "$7" --args -title1="$3" -title2="$5" -readonly


1

How did you check that env vars are the same? Running printenv or something similar from mc is unreliable: there bashrc has been sourced after mc was started. Instead you should look at /proc/XX/environ where XX corresponds to mc's pid. You need to convert 0 bytes into newlines, e.g. (if only a single mc process is running): tr '\0' '\n' < /proc/`pidof ...


0

In Msys on Windows try this (I found the accepted answer didn't work in Msys) at &> /dev/null && echo "Running as admin" || echo "NOT running as admin" This relies on the return code of at being zero only when running as admin.


0

Looking at the terminfo defitions (misc/terminfo.src inside the ncurses tarball) I have a feeling that terminal descriptions with + characters in their name are not complete descriptions, rather they are small building blocks from which the actually useful entries (e.g. xterm, xterm-256color) are built up. I'm not sure why they are installed at all, maybe ...


1

An alternative. Same caveats apply as @Adam C's answer; don't run this without testing it. Some demo data: $ mkdir testing; cd testing $ mkdir one two three four "fi ve" $ touch one/one.txt two/two.txt three four/keep.txt fi\ ve/.hidden Simulate deleting all but four/ $ find . -mindepth 1 -path ./four -prune -o -exec echo would remove "{}" + Output: ...


3

WARNING: running any command to recursively delete files is dangerous. Always, always test before blindly running such dangerous commands, and never run them as the root user (or with sudo etc.), ever. This is relatively easy to do with a bit of bash, you could even make it an argument you pass in if you are going to do this a lot. But, for a once off, ...


0

The \ doesn't make any difference whatsoever, since the shell eliminates that. The chown utility will receive a literal nobody: as its first argument. The presense vs. absence of : does make a difference, though. See chown's manual page for clear description. sudo chown nobody folder/ changes the owner, but leaves the group of the file intact. sudo chown ...


0

Open two terminals. In the second one, figure out its tty device by running the tty command. It'll print something like /dev/pts/8. In the first one, run your app redirecting its stderr here, e.g. myapp 2>/dev/pts/8. I use this so often for debugging that I set the terminal title to contain the tty number, so I don't even have to run the tty command. I ...


0

Why is this behavior "hateful"? You're the first one I hear complaining about this feature. gnome-terminal doesn't support this, but apparently it's a one-line code change if you're comfortable enough compiling and installing gnome-terminal for yourself. In src/terminal-screen.c in the line vte_terminal_set_mouse_autohide (terminal, TRUE); change TRUE to ...


0

I don't think it really matters. If you do a stress-test, you'll find gnome-terminal spending most of its time handling the input; updating the display is relatively cheap compared to this. Note that for many years there was a stupid bug which made gnome-terminal (and all vte-based emulators) very slow. It was fixed in vte-0.36, bringing a ~10x improvement. ...


1

There are two "problems" with these shortcut keys. The first is: these are handled by gnome-terminal itself by default; they shuffle the order of the tabs. You need to disable this behavior in Prefs -> Shortcuts. The second is: after this, these are still handled by gnome-terminal the way Shift+PageUp (without Ctrl) is handled; that is, scroll in the ...


0

Unfortunately mainstream gnome-terminal has removed the transparency option, but Fedora 21 and Ubuntu Vivid have a patch that bring it back. You can find this patch in their repos, and recompile gnome-terminal with this patch for yourself. (At this moment unfortunately I wouldn't recommend using Terminator. It's stuck with a very old (Gtk+2-based) libvte, ...


0

You need to start each path with /, otherwise that path will be relative to the current working directory, instead of an absolute path from the root of the filesystem. I wouldn't have expected that to cause a problem, but maybe bash's parser for the PATH variable choked on the relative paths. So you need: export ...


1

The following steps should help: Break out your status line configuration into two different files: one configured with the colors you want for the dark theme, and another with the colors you want for the light theme. Save those files in your home directory (I made a .tmux directory and they live there) Add something like the following to your ...



Top 50 recent answers are included