Tag Info

Hot answers tagged

166

Ports are a concept of UDP and TCP. Ping messages are technically referred to as ICMP Echo Request and ICMP Echo Reply which are part of ICMP. ICMP, TCP, and UDP are "siblings"; they are not based on each other, but are three separate protocols that run on top of IP. Therefore you can not ping a port. What you can do, is use a port scanner like nmap. nmap ...


59

Linux is a kernel, Debian is a distribution of that kernel and a bunch of software to actually interact with the system. I can now take Debian and change the logo on the boot screen to my own logo and then my distribution is based on Debian (in a very primitive way). Usually, the adjustments that are made in a derived distribution are more substantial. ...


44

Use rm \\ (escape the backslash with another backslash). Note that this also works similarily, for directories named \ (using either rmdir, or rm with the -r flag). Example: >mkdir demo >cd demo >touch \\ >ls -l total 0 -rw------- 1 hennes users 0 Jul 29 20:25 \ >rm \\ >ls -l total 0


43

I use Telnet, since its built into lots of platforms with no additional downloads. Just use the telnet command to connect to the port you want to test. If you get the message below, or a message from the service itself, then the port is alive. Minty16 ~ $ telnet localhost 139 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. If you ...


35

You may want to use the truncate command: truncate --size=1G test.txt SIZE can be specified as bytes, KB, K, MB, M, etc. I assume you can calculate the desired size by hand; if not, you could probably use the stat command to get information about the file's current size.


33

The easiest way to determine if 2 discs are the same is to run a hash of both of them: sudo md5sum /dev/cdrom If the hashes match, the disks are exactly the same. However this will not tell you what is different about them. Even if a single bit is different you would get a totally different hash. You can check the partition table of a disc with fdisk: ...


31

Linux is a kernel — a (complex) piece of software which works with the hardware and exports a certain Application Programming Interface (API), and binary conventions on how to precisely use it (Application Binary Interface, ABI) available to the "user-space" applications. Debian, RedHat and others are operating systems — complete software ...


26

You probably only need a small amount of swap. When you have sufficient RAM for your computer's typical working set, which I'm pretty sure you do, you only need swap for two things: You need swap to get information that will likely never be accessed out of RAM to free up more space for disk cache. Many applications run on system startup and will never be ...


23

RedHat recommends 4GB on a machine with 64GB https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007 However, sizing swap is more of an art than a science. It depends on what the machine is being used for, how much disk space and memory you have, and other factors. Remember, ...


22

For Unity (shipped by default since the Ubuntu12), Gnome, LXDE, Cinnamon and MATE, the Ctrl+Alt+T keyboard shortcut will work if you are already logged in. If you are using Xfce (Xubuntu), however, it would be Super+T. (Note that Super is the Windows key) And as far as I am aware, in KDE, while it is also Ctrl+Alt+T, for some reason, there are issues with ...


21

Just hit Ctrl+Alt+F1 to switch to another tty. That's probably easiest.


19

You can use netcat to connect to a specific port to see if you get a connection. The -v flag will increase the verbosity to show whether the port is open or closed. The -z flag will cause netcat to quit once it has a connection. You can then use the exit codes through $? to see whether or not the connection was established or not. $ nc -zv localhost 22 ...


18

perl -we 'open( FILE, "< ./test.txt" ) && truncate( FILE, 8 ) && close(FILE);' opens the file for reading. However, to truncate the file you need to modify it, so a read-only file handle isn't going to work. You need to use the "modify" mode ("+>"). As a side issue, it always amazes me when people let system calls fail silently and ...


12

A general tactic for manually deleting files with awkward characters in their names is rm -i ./* This will prompt you to choose whether or not to delete each file in the directory.


12

I had this error today. After doing some search it turned out it was caused by my upgrade from Ubuntu 13.04 to 13.10. The fix was simple: run "sudo apt-get install php5-json". Then I restarted apache: "sudo service apache2 restart"


11

You can also unlink by referencing the inode of a file linus ~/test $ touch \\ linus ~/test $ ls -li total 0 15204561 -rw-r--r-- 1 pat sudo 0 Jul 29 23:03 \ linus ~/test $ find . -inum 15204561 -exec rm -v {} \; removed `./\\' linus ~/test $ ls -li total 0 linus ~/test $


11

The lsblk command is great for this: lsblk -o NAME,PHY-SeC The results: NAME PHY-SEC sda 512 ├─sda1 512 ├─sda2 512 └─sda5 512


11

Yes, use HPing to do that: $ sudo hping -S -p 80 google.com HPING google.com (p5p1 77.237.27.37): S set, 40 headers + 0 data bytes len=46 ip=77.237.27.37 ttl=58 id=25706 sport=80 flags=SA seq=0 win=29200 rtt=7.5 ms len=46 ip=77.237.27.37 ttl=58 id=25707 sport=80 flags=SA seq=1 win=29200 rtt=7.4 ms len=46 ip=77.237.27.37 ttl=58 id=25708 sport=80 flags=SA ...


10

Ubuntu has started if you are able to do commands, it is just the gui you are missing. Now you just need to delete things with the rm command. Please be careful, and make sure you understand what you are doing. Perhaps you can delete some old logs? In the /var/log folder there are lots of logs. Anything ending in a number such as .1, or a number with a ...


10

On Linux, you need enough swap so that the total virtual memory available (RAM + SWAP) is enough for all the processes you want to run at once and their maximum virtual footprint. If you have less swap than this, or no swap at all, then the following situation happens: the system runs out of memory trying to allocate a page. But, this is still a soft ...


10

You can use dd to do a disk dump, i.e. dumping the disk byte-by-byte. Feed it to md5sum afterwards to compute the checksum. dd if=/dev/sdb1 bs=1M count=950 | md5sum where if means where to read from; /dev/sdb1 is your USB device; bs indicates Block Size or how much dd is going to read at a time and 1M means 1024*1024 bytes; count means how many blocks to ...


10

Here's a list things that could potentially solve this problem, each balances the trade-offs you have to make differently so you'll have to make your own choices and try things out for yourself: Unison - as mentioned by others, this is run manually, but is very fast, reliable and effective. Requires both machines being synchronised to be on at the same. It ...


9

When using pipes, you want to consider the order of operations before fashioning your pipeline. You'll also want to have a good understanding of what each command does. For clarification: /etc/passwd and /etc/group are not directories, but files. You're on the right track using ls for directories, but in this case it is not needed. To get you started, here ...


8

Sendmail requires that the result of "hostname" be a fully qualified domain name to start cleanly. Set the hostname to something like piotr-probook.localdomain and update /etc/hosts. /etc/hosts 127.0.0.1 piotr-probook.localdomain piotr-probook localdev localhost


8

Red Hat, Debian, etc. are all distributions ("distros") of Linux. Keep in mind that Linux is technically only the kernel, which is a single part of a working and useful system. You'll need basic utilities, decisions regarding where things live in the system, a mechanism for installing and updating software, and conventions/standards (such as the ...


8

I would personally try to boot from a live CD and try mounting /dev/sda7 that way. Once you can get it mounted, you should then go through and see what large files you can delete to free up space. I hope this helps!


8

There are two ways to do this: Apt-get specific: $man apt-get [...] -y, --yes, --assume-yes Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package, trying to install a unauthenticated package or removing an essential package occurs ...


7

Just comparing the folders and files misses other things about the disc. If you create an .ISO image file from each disc and byte compare them you'd have a better idea of the discs are really the same or not.


7

workaround try this when it happens: ibus-daemon -rd http://youtrack.jetbrains.com/issue/IDEA-115661 http://youtrack.jetbrains.com/issue/IDEA-78860


7

With Linux there are distributions or distros. Literally hundreds of them. Linux is Open source, so anyone (or any group or company) can modify any part of the OS that they wish. This is why some versions have different installers (.deb vs. RPM or just tar) and different commands (apt-get vs. yum). Most distros choose a target use or specific uses and ...



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