Hot answers tagged

14

bc with a little help from paste to get the lines in a single one with + as the separator: paste -sd+ file.txt | bc To use the output of grep (or any other command) instead a static file, pass the grep's STDOUT to the STDIN of paste: grep .... | paste -sd+ | bc Example: % cat file.txt 1 3 4 1 4 3 1 2 % paste -sd+ file.txt | bc 19 % grep ....


10

The command line application ImageMagick can read, write and edit DDS files: andrew@ilium~$ identify -list format | grep 'Microsoft DirectDraw Surface' DDS* rw+ Microsoft DirectDraw Surface DXT1* rw+ Microsoft DirectDraw Surface DXT5* rw+ Microsoft DirectDraw Surface andrew@ilium~$ The codes after DDS,DXT1 and DXT5 signify: * ...


8

You could use awk, too. To count the total number of lines in *.txt files that contain the word "hello": grep -ch 'hello' *.txt | awk '{n += $1}; END{print n}' To simply sum the numbers in a file: awk '{n += $1}; END{print n}' file.txt


6

You can use the stat command stat -c '%s' filename See man stat for details and other options Or, with du du -b filename


6

Downloading, unzipping and running Xonotic can be accomplished as follows: cd wget http://dl.xonotic.org/xonotic-0.8.1.zip unzip xonotic-0.8.1.zip cd ~/Xonotic ./xonotic-linux-glx.sh If this does not run particularly well (ran fine here) you can use: cd ~/Xonotic ./xonotic-linux-sdl.sh A few other choices in there including a Makefile that installs to /...


3

You can just use the find command. find /path/to/where/to/search -type f -perm -666 Enter path where you want to do the search. The -type f meand that only files will be searched. Finally -perm 666 means that only files with read/write permissions for all users will be matched. Please note that if file has also executable permission for any user it will ...


2

You're probably doing nothing "wrong", but wiping data is much harder than in the floppy disk days. Unless your filesystem is non-journalling AND you never defragment the filesystem, the only guarantee to make sure data is completely gone to software is to destroy the entire filesystem, or on an SSD, security wipe the whole disk. See this answer (the "...


2

par and par2 files were more common in the days when Usenet was a little more popular and the parchive was intended to increase the reliability of transferring files via newsgroups. Under Xenial Xerus you can use these files with pypar2: sudo apt-get install pypar2 This give a basic gui from which to manipulate the files: Further Reading: Par2 Files ...


2

Have you tried XnViewMP? It's known to work on some dds files, but some read errors have been reported too. You can't find it in official repositories, but here: http://www.xnview.com/en/xnviewmp/#downloads. Don't worry, it's free, paid version is for Windows only.


2

Your command should be : grep 'unix$' your_file | sort Of course you shoud replace your_file with the file you want to sort.


2

First, this command will find and delete all files older than 7 days in any subdirectory in /home whose name starts with securityuser: find '/home/securityuser*' -mtime +6 -type f -delete You need -mtime +6 and not +7 because -mtime counts 24h periods. As explained in the -atime section of man find (-mtime works in the same way): -atime n ...


1

as per i my knowledge: try find command like this: find ./dirc/* -mtime +6 -type f -delete ./dirc/* : is your directory (Path) -mtime +6 : modified more than 6 days ago (therefore, at least 7 days ago) -type f : only files -delete : no surprise. Remove it to test before like rm


1

Unfortunately unlike the x86 world the arm world doesn't have a common "platform". PCs all boot in the same way, they have crucial system hardware like timers in the same place. They all have the registers used to enumerate the PCI bus(es) in the same place. They have a BIOS that passes further details of the hardware to the OS. Arm boards don't, each SoC ...


1

Firefox will create a temp folder following the pattern /tmp/mozilla_${USERNAME}${INDEX} where ${USERNAME} of course represents your user name and ${INDEX} an index starting at 0 to avoid conflicts between multiple running instances. So for me this directory could e.g. be called /tmp/mozilla_bytecommander0 Inside this directory, it will save the files ...


1

Use numsum from the package num-utils! (You may need to sudo apt-get install num-utils) The command numsum does just what you need by default; $ numsum file.txt 19 Reading the test numbers line by line from stdin: $ printf ' 1 3 4 1 4 3 1 2' | numsum 19 Or reading from one line: $ printf '1 3 4 1 4 3 1 2' | numsum -r 19 More utilities The ...


1

You can use awk, a native linux application usefull to scanning and processing files with a pattern per line. For your question, this will produce what you want: awk 'BEGIN { sum=0 } { sum+=$1 } END {print sum }' file.txt Pipes are also accept: cat file.txt | awk 'BEGIN { sum=0 } { sum+=$1 } END {print sum }'


1

You can also go the other way and set the share on our Linux machine, you can follow these instructions on how to do that. help.ubuntu.com - How to create a network share Procedures All commands must be done as root (precede each command with 'sudo' or use 'sudo su'). Install Samba sudo apt-get update sudo apt-get install samba Set a password ...


1

Share the files from your windows computer by right clicking on the folder that contains them, and picking "Sharing". Give it some basic level of access. Press Windows Key+R and type cmd, then click ok. type ipconfig and get the IP address of your wireless adapter. From your Ubuntu machine, open a new file window and click (from the menu bar) GO --> Enter ...



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