Advertisement
rokytnji

Commands

Nov 4th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.53 KB | None | 0 0
  1. Commands
  2. lsb_release -a
  3.  
  4. #OS and distribution information.
  5.  
  6. dmesg|grep WORD
  7.  
  8. #Boot messages piped, where “WORD” is the search subject.
  9.  
  10. cat /var/log/Xorg.0.log|grep EE
  11.  
  12. #list errors for the X Window System.
  13.  
  14. lsusb -- list usb devices
  15. lshw -- list more detailed hardware information of your system including chipsets, motherboard manufacturer, RAM details, etc (I had to install this separately from the Debian repos)
  16.  
  17. alien -iv: [package name] alien converts .rpm to .deb
  18.  
  19. du -ch: /path/to/folder check file or directory size in total
  20. amount and in human-readable terms.
  21.  
  22. dpkg-reconfigure fontconfig-config: font quality check
  23.  
  24. grub-install:*install grub on your drive*
  25.  
  26. dmesg | more: shows boot-up messages
  27.  
  28. module-assistant:*module-assistant is the command-line tool for
  29. handling module-source packages that have been prepared for the Debian distribution. It helps users to build and install module package(s) easily for one or more custom kernels.
  30.  
  31. lsmod: lists loaded kernel modules
  32.  
  33. lspci: lists info on hardware lshw lists more detail and apt-get install hwinfo for another good tool. mkxf86config for monitor capabilities
  34.  
  35. umask: set in env.vars. (.bashrc?). Decide what your default environmental file permissions should be for thinks such as touch and text editors. Ex. U: 7 G: 5 O:0. Subtract this number from 777 and the result (027), is your umask
  36.  
  37. whatis: microscopic man page. Form: whatis mkdir
  38.  
  39. cmp: create a file, modify it and save it as a different file. use cmp to compare the differences between the two files
  40.  
  41. df -Th: report file system disk space usage
  42. more /proc/cpuinfo: shows info on the cpu
  43.  
  44. ddcprobe: monitor info
  45.  
  46. modprobe “device” **modprobe intelligently adds or removes a module from the Linux kernel: note that for convenience, there is no difference between _ and - in module names
  47. update-alternatives --config (item) check in /etc/alternatives for list.
  48.  
  49. alsamixer: sound input/output config gdebi
  50.  
  51. checkinstall: (run in the root directory of a package source tree). checkinstall -D turns most source into a .deb (use dpkg -i to install). The -R option turns it into a .rpm package
  52.  
  53. tar jxvf: unpacks .tar .bz package in one fell swoop
  54.  
  55. dpkg -l package* | grep -i ^ii example, lists actual package name so it can be removed (in this case by dpkg)
  56.  
  57. uname -a finds kernel version
  58.  
  59. readlink: display value of a symbolic link. The following example shows which driver module controls the eth0 device:
  60.  
  61. readlink /sys/class/net/eth1/device/driver/module
  62.  
  63. cat /proc/cpuinfo: *cpu info
  64.  
  65. apt-get moo: *just kinda fun
  66.  
  67. ifconfig [interface]*up/down: brings specified nic on or off line
  68.  
  69. top: shows real-time cpu usage by process. -U username for specific user
  70.  
  71. apropos: info on man pages- very cool*
  72.  
  73. stat [filename]: verbose info on files
  74.  
  75. dpkg --list: shows all dpkg installed packages
  76.  
  77. df -h or better yet fdisk -l:*List hard drive info/names
  78.  
  79. ctrl-alt-backspace: kills xserver
  80.  
  81. runlevel: shows current runlevel
  82.  
  83. telinit x: change runlevel
  84.  
  85. sysv-rc-conf: start/stop specifications for init scripts by runlevel. You can also go to the /etc/runlevel and replace the “S” with a “K”
  86.  
  87. update-grub: updates grub boot menu
  88.  
  89. sudo blkid /dev/sda | grep PTTYPE : tells drive partition type like gpt or msdos
  90.  
  91.  
  92. gcc --version: gnu compiler version
  93.  
  94. tzselect:* sets timezone
  95.  
  96. pmount: ("policy mount") is a wrapper around the standard mount program which permits normal users to mount removable devices without a matching /etc/fstab entry
  97.  
  98. pstree [process]:*display a tree of processes
  99.  
  100. dhclient: requests and renews dhcp address from dhcp server
  101. -----------------------------------------------------------------------------------------------------------------------
  102.  
  103. Get into root
  104.  
  105. sudo -i
  106. sudo bash
  107. sudo su -
  108. sudo su
  109.  
  110. sudo apt-get autoclean to clean out dead files
  111. Find file type in Linux on Mounted Partiton::: _df -T
  112. Root Access to Nautiless File Manager::::::::::::gksu nautilus &
  113.  
  114. ______________________________________________________________________________________________________________________----------------------------------------------------------------------------------------------------------------------------
  115. cat /etc/issue to find out what distro u are using
  116. cat /proc/version
  117. dmesg | head -1
  118. lsb_release -a
  119. ________________________________________________________________________________________________________________________----------------------------------------------------------------------------------------------------------------------------
  120. If it is a built-in or PCI wireless, use this command to determine the card info:lspci -nn
  121. For Fedora:/sbin/lspci -nn
  122.  
  123. If it is a USB wireless, use this command. It will not give as much info as for a PCI card, but it is useful anyway:lsusb
  124. For Fedora:/sbin/lsusb
  125.  
  126. To see a list of all driver modules that your system is loading, use this command. I usually can spot a wireless driver in the list:lsmod
  127.  
  128. To see any error codes that your system may have generated concerning the wireless, enter this command.:dmesg
  129.  
  130. Post any relevant wireless messages or wlan errors in your thread. Many cards require firmware to be loaded before they will work, so look for firmware errors in the dmesg output. A command that will only give firmware messages can be used:
  131. dmesg | grep firmware
  132.  
  133. #also
  134. echo uname: && uname -a -m -p && echo lspci: && lspci && echo lsusb: && lsusb && echo lsmod: && lsmod && echo ifconfig: && ifconfig && echo ifconfig -a: && ifconfig -a && echo iwconfig: && iwconfig && echo resolv.conf: && cat /etc/resolv.conf && echo route: && route -n
  135.  
  136. su -c "hwinfo --wlan"
  137.  
  138.  
  139. lspci -nnk | grep -i net -A2
  140.  
  141. su -c "hwinfo --netcard"
  142. ________________________________________________________________________________________________________________________
  143. The Linux distribution and version can be useful, as well as the kernel version. To obtain the kernel version, use this command.: uname -r
  144. ______________________________________________________________________________________________________________________
  145. For wiping the MBR only, use this command: dd if=/dev/zero of=/dev/sda bs=446 count=1
  146.  
  147.  
  148. For wiping the entire drive, go with this command:dd if=/dev/zero of=/dev/sda bs=512 count=1
  149. ______________________________________________________________________________________________________________________
  150. e: sudo apt-get remove (instead of install, just taking a chance here) xserver-xorg and that worked to remove the whole thing then: 'sudo apt-get install xserver-xorg' and it worked like a charm!
  151. ________________________________________________________________________________________________________________________
  152. To Open Wajig type gjig in terminal
  153. _________________________________________________________________________________________________________________________
  154.  
  155. To empty root file in trash type sudo rm -rf ~/.local/share/Trash/files/*
  156. --------------------------------------------------------------------------------------------------------------------------
  157. To compile kernel modules, you need to install a few things first.
  158.  
  159. kernel-devel (kernel source)
  160. kernel-headers
  161. gcc
  162. make
  163. __________________
  164. Paul
  165. _______________________________________________________________________________________________________________________
  166.  
  167. Manually mount and unmount USB MP3 Player (No other Flashdrives Plugged in)
  168.  
  169. sudo mount -t vfat -o rw,umask=0 /dev/sdb1 /media/USB
  170.  
  171. Will mount the device Read/Write and give full access to all users as if they were root. Don't forget that with a manual mount, you must manually unmount before disconnecting or you risk data corruption and a possible device hang (on the computer, not the stick). You will also need to do this before remounting the device (or there is an alternate method, but it's simpler for me to explain it this way).
  172.  
  173. sudo umount /dev/sdb1
  174. _________________________________________________________________________________________________________________
  175. ________________________________________________________________________________
  176.  
  177. ########blacklist############
  178.  
  179. sudo tee /etc/modprobe.d/blacklist <item to be blacklisted goes here>
  180.  
  181. __________________________________________________________________________________________________________________
  182.  
  183. #############When I want to certain info on how many cores I am running###########
  184.  
  185. grep 'model name' /proc/cpuinfo|sed -e 's/model name.*: //'|uniq
  186.  
  187. __________________________________________________________________________________________________________________________________
  188.  
  189. ######record desktop####################
  190.  
  191. ffmpeg -f x11grab -s 1024x768 -r 24 -an -threads 2 -sameq -i :0.0 screencast.avi
  192.  
  193. ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s 1366x768 -r 25 -i :0.0 -sameq /home/harry/Video/test2.avi
  194.  
  195. _____________________________________________________________________________________________________________________________________
  196.  
  197.  
  198. Hold down the Alt and SysRq (Print Screen) keys.
  199. While holding those down, type the following keys in order, several seconds apart: REISUB
  200. Computer should reboot.
  201. Also
  202.  
  203. Alt+PrintScreen+K
  204.  
  205. To kill X.
  206. __________________________________________________________________________________________________________________________________________________
  207. ########Test Webcam in Terminal################
  208. mplayer tv://
  209.  
  210. ####################################Find dependencies in a package install####################################
  211.  
  212. apt-cache show <package name goes here> | grep ^Depends | sed 's/, /\n/g;s/^Depends: //' | sort -u
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement