New answers tagged

0

Perhaps plugins.rar is corrupt, and doesn't look like a "RAR archive". See what your system thinks the file is with file plugins.rar. Re-get the file, lather, rinse, repeat.


0

You know what, update the man page ...


0

Many thanks for your help! Followed the steps by 1nfiniti on Ubuntu 16.04 amd64 and it worked great with Logitech MX5000 keyboard and mouse combo. But when I rebooted the computer, the keyboard didn't type again. It showed as connected but not paired on Bluetooth Settings. However, the mouse worked fine. Having a look at bluetoothctl reference ...


0

Moving the files with extensions to /target/directory, assuming regular notion of extensions: find ~ -type f -name '?*.?*' -exec mv -t /target/directory/ {} + This will find and move files recursively starting from your home directory. I have used ?*.?* instead of just *.* so that hidden files in the form .foobar and files like foobar. are excluded. If ...


0

I discovered a method that does not rely on the arcane syntax of the input to: date -d This function solves the problem: function calculateTargetDay { # Calculates the day in the month of the nth. weekday in month # $1 is the current date stored in an array as yy mm dd integers # $2 is the day of the week as an integer, Monday = 1 # $3 is the week of the ...


1

You want to move just the files and not the directories nor the files in the directories. You can use the find command with ~ (=home) as argument and also use the maxdepth 1 (search only the parent directory) and type f (file). The result (all files in given directory) is than piped to xargs (the -0 option is to ignore special meanings of some chars) that ...


7

[ brackets are alias for test command and there is no > sign in the regular test command. Use [ $i -gt 3 ] $ for i in {1..5}; do echo $i; if [ $i -gt 3 ] ; then echo $i; fi; done 1 2 3 4 4 5 5 You could use bash's arithmetic expansion (()) as well $ for i in {1..5}; do echo $i; if (( $i>3 )) ; then echo $i; fi; done 1 2 3 4 4 5 5 You could ...


2

You have two echo commands in there the first one isn't necessary. Editing your command to this should work: for i in {1..5}; do echo $i; if [[ $i -gt 3 ]]; then echo $i; fi; done As an extra improvement, if this command will only be run in bash, It's worth using [[ instead of [. It does much the same thing but has some nice additional functionality.


1

How about something like this perl -F, -alne ' my @a = split "C", @F[1]; my @b = (map { $_ ? length $_ : "" } @a); print join ",", (@F, join "c", @b) ' file.csv c32_g1_i1_3,SCIPKHEECTNDKHNCCRKGLFKLKCQCSTFDDESGQPTERCACGRPMGHQAIETGLNIFRGLFKGKKKNKKTKG,1c6c6cc8c1c13c1c31 ...


1

look here http://stackoverflow.com/questions/6477415/how-to-set-oracles-java-as-the-default-java-in-ubuntu not the accepted answer but Barracuda's, which I reproduce below: to set Oracle's Java SE Development Kit as the system default Java just download the latest Java SE Development Kit from [here][1] then create a directory somewhere you like in ...


1

Inspired from above answers, here is command line version. #!/usr/bin/env python import sys pattern = sys.argv[1] fileName = sys.argv[2] count=0 temp = [] with open(fileName, "r") as file_to_read: for line in file_to_read: if pattern in line: #IN case you want to have number of hits count=count+1 ...


1

Something like the following would accomplish your purpose, with 'testing' being a text files with a list of URL images: cat testing | xargs -n 1 -P 8 wget -q Works beautifully on my system! You can manipulate the -P option as the man pages describe: -P max-procs Run up to max-procs processes at a time; the default is 1. If max-procs is 0, xargs ...


0

Keep it simple.. rename 's/.*\.(\w+)\.omg\..*mp4$/\L$1.mp4/' *.mp4 Example: $ echo 'bla.super.lol.S01E03.omg.bbq.mp4' | perl -pe 's/.*\.(\w+)\.omg\..*mp4$/\L$1.mp4/' s01e03.mp4


0

You need a system tray for the tray icon you want (nm-applet), which DWM doesn't provide by default. Their are a number of stand-alone tray programs for light weight window managers like DWM. You could try the venerable stalonetray or systray, the latter of which is by the same author as DWM.


1

What you want is to use getopts . Bellow is a typical template I use in my script. Usually I have a main() function and parse_args() function, and I pass arguments form one to the other. #!/bin/bash #set -x parse_args() { echo "Hello, I'm parse_args function" local OPTIND opt # OPTIND must be there, # opt can be renamed to anything # ...


0

You can do this in many many programming languages (to name a few phython, c, c++, java, etc. etc.), but lets assume you want to do a custom command in bash (the code set of your terminal), you can do this like in the following example. Lets further assume you want to create a command for backing up your files to a location you want to add as custom ...


0

Well, the file that you're putting between the quotes, to execute as a bash command, is a 15917 byte bash script (written by Somebody Else, and you're running it without inspection, but that's off topic). If you split it up into simpler commands, you could: curl -s https://install.prediction.io/install.sh >install.sh # inspect install.sh here bash ...


8

With rename (prename): rename -n 's/^bla\.super\.lol\.[sS](\d+)[eE](\d+)\..*(\.mp4$)/s$1e$2$3/' *.mp4 -n does the dry-running, if you are satisfied with the potential renaming, just remove -n to let the actual renamimg to take place: rename 's/^bla\.super\.lol\.[sS](\d+)[eE](\d+)\..*(\.mp4$)/s$1e$2$3/' *.mp4 Example: $ ls -1 ...


1

#!/bin/bash IFS="\n" # Handle files with spaces in the names for file in *.mp4; do newfile="${file/bla.super.lol./}" # Strip the prefix you don't want newfile="${newfile/S/s}" # Change the first S to an s newfile="${newfile/E/e}" # Change the first E to an e newfile="${newfile.%omg.bbq*}" ...


4

Well, to make it official here is your answer. As you already stated a comment line is a comment line, this wont even change if you enter one directly in terminal. This counts as well for lines beginning with #!, they are simply only comments for the shell/terminal when typed in by hand. Another option could be to echo your comment directly into the ...


0

Resolved. 1) I should not use boot flash creators like unetbootin with server verion 16.04LTS. When I try to install by adding iso image to virtual cdrom (ILO sweet feature) I see another result. OS show visible POST when loading modules. After boot I have normal terminals. It also resolve bug with default tty7(now default tty1). On this site I see that ...


2

Good explanations here already. I just wanted to add that ideally you shouldn't use file extensions for executables. Usually you need to accomplish something relatively easy and you start with a little shell script. Over time you start adding more and more functionality to your script, until it arrives some time that it becomes unmaintainable or you need ...


32

You're confused. The .sh extension is only a hint to humans, and has absolutely NO effect on how the system handles the file. Unix/Linux did not make the Windows' Secrets.pdf.exe blunder. Here is what happens when you type foo: Redirection for STDIN, STDOUT and STDERR are set up. The shell checks its internal hash table to see if it already knows a ...


8

Key point is this: Extensions are irrelevant in any Unix-like system system.A filename is just name and has no effect on whether or not script or compiled executable can run. A programmer may add a .sh extension to designate that a file is shell script, or .py for python script, but unlike Windows , any unix doesn't care about naming, it cares about ...


4

To run files without an extension you normaly dont need to do much, just make sure you have (in case of bash scripts) the proper shebang line at the very first line: #!/bin/bash then you aswell need tho make the file executable for the system by chmod 755 yourfilename This is the same as using chmod +x yourfilename the numbers are easy explained. It ...


3

sed and arithmetic do not mix. The right tool for jobs like this is awk. Consider this test file: $ cat test.txt /nonmatching/line 1 /home/username/Pictures/properties/wallpaper/span/tree.jpg 2 /another/non/matching/line 5 We can increment the number of the line that you want with: $ line="/home/username/Pictures/properties/wallpaper/span/tree.jpg" $ ...


1

You can either switch to a TTY by pressing ctrl+alt+F1, and login there, or start a terminal emulator, often by pressing ctrl+alt+t.


1

It seems to be a part of a Cloud9 SDK. It seems very strange for them to install software to root in a hidden folder and even stranger that they're not able to remove it properly afterwards. But if your goal is to remove it, you can do that by running sudo rm -Rf /root/.c9


0

mv -T /home/user/oldname /home/user/newname That will rename the directory if the destination doesn't exist or if it exists but it's empty. Otherwise it will give you an error. If you do this instead: mv /home/user/oldname /home/user/newname One of two things will happen: If /home/user/newname doesn't exist, it will rename /home/user/oldname to ...


2

Run it with (replace <command> with the command you use to run it): <command> & disown


0

You can use nautilus command as well as gnome-open . In some cases the gnome-open command will not work.


3

I believe you have missed part of the command. ls -alt | more http://linuxcommand.org/man_pages/ls1.html -a : do not hide entries starting with . -l : use a long listing format. -t : sort by modification time. | : pipe the result to the next part of the command. more : present the result one page at a time.


0

Not a perfect answer, but I do ifconfig | grep 'inet addr:' | sed 's/.\{40\}$//' | sed 's/inet addr://g' | tr -d '[:blank:]' | tr --delete '\n'


0

Press "CTRL+T" on your keyboard to open up the terminal. Then type in ifconfig, press enter and your ip address will be shown as inet addr xxx.xxx.xxx.xxx.


0

ps -f U $USER will show you the logged in user activity. You can replace the $USER with any user id or username. Please note you can't use it in conjunction with the -f option as incorrectly stated above.


2

This is very possible. First your need to disable graphical boot. Then you want "Single User Mode" (warning there are some pretty extreme security risks with this), finally you need to address what to do when you want to run a GUI. See How do I boot into single-user mode from GRUB? Essentially you add the option single to your GRUB boot config. You can ...


1

When youre looking for good tutorials on how to use the terminal and bash scripting i have two links for you. Don't let the old date of the beginners guide fool you, its a very good one and still valid. Bash Guide for Beginners - Machtelt Garrels - 2008 Advanced Bash-Scripting Guide - Mendel Cooper - 2014


6

startx and xinit can both be handed an initial client to start with. The following command: startx /usr/bin/firefox will spin up an xserver on the TTY you are currently working on, and start a single instance of firefox in something like full screen. You can switch to other tty's to avoid having to bring down the firefox session just to get back to the ...


1

I like ratpoison for what you are trying to do. I wont post a screenshot because you can't tell the difference from a screenshot of xterm (or whatever application you are running). In its standard configuration it displays one window full screen. You can split it to display multiple windows, but for most of my daily use I don't. If you start a terminal ...


0

put steps 1,2,3 into script1.sh put step 4 into script2.sh Then setup cron for the appropriate user to execute the scripts according to your schedule: minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command 01 * * * * /usr/bin/directory/script1.sh 30 2 * * * /usr/bin/directory/script2.sh script1.sh ...


2

One solution could be setting up cronjobs to lock/unlock the game directory. To do so, follow the steps below. Make sure cron-daemon is installed sudo apt-get install cron Setting up the cronjob to run for root Start editing the cronjob by issuing following command: sudo crontab -e Add the folowing lines into the editor: 00 */1 * * * ...


0

This is because the first example is executing the startup script located at /etc/init.d/nginx In the second example you just typed in a bare name thus it looks for the command following your $PATH variable to find the first reference which will be the actual nginx binary at /usr/sbin/nginx These are two different things, if you want to execute a file in ...


0

Unfortunately, this isn't uncommon with Ubuntu and seems to plague LTS releases worse than regulars for some reason. The failing upgrade will cause things to get stuck halfway between releases, and you need to kick it in the shin to get it going again. Assuming you can get a command prompt on the system (CTRL-ALT-F1) and login as yourself, try the ...


0

glenn jackman's point is well taken. But, to solve your immediate use case, how about backticks? Like so: `echo $COMMAND` For example, this works: COMMAND='ls /' `echo $COMMAND`


0

You can quickly switch to a command line interface using [ctrl][alt][F1] (works with [F1]-[F12] I think). One of these will also switch back to your GUI for when you need one; I think it's [ctrl][alt][F8] on Mint, so you might want to try that one. I'll throw myself in the "use a tiling window manager" camp though; i3 really is a great tool.


1

Look into using a window manager like FVWM2, rather than a "desktop". You can configure it to open just one (or more) xterms on boot, can run any graphical application such a web browser from the command line, aren't bothered by desktop stuff like "system tray" or icons for everything, but can add any bits of that you might find to actually be useful. (In ...


9

I agree with Eduar, you probably want a Tiling/Dynamic Window Manager (WM). But no-one's directly addressed: What I would like to see is when I boot my machine into the command-line Currently you should boot into a Display Manager (DM) where you login. So you have two options, boot into a shell or a console DM. If you have no DMs set up then you will ...


0

To copy, use Ctrl+Shift+C To paste, use Ctrl+Shift+V or Shift+insert


2

I think you can get what you want without throwing away the desktop. As other answers have covered, you will likely get better performance with the desktop running anyways and there are technical reasons running linux like an older OS wouldn't really work. I am going to use gnome as my example workflow because it's what I know, but I would guess other ...


0

use libertine-container-manager exec -c "setxkb dk dvorak" or any ways -c "and the command you want to run"



Top 50 recent answers are included