MAS Linux Commands

From DDCIDeos
Jump to navigationJump to search

Useful Links


BASHRC File

The .bashrc file is located in your root directory. The following modifications are recommended:

  • Add lots of alias commands to make your life easier. Examples:
    • Pathnames to frequently accessed folders: alias a653_mainline='cd ~/scm/Deos/products/arinc653/runtime/branches/mainline && pwd'
  • Display the project name in the title bar of the window (useful in cygwin/BASH):
DESK_NAME=`cygpath -m $DESKHOME | sed -e "s/.*\/\(.*\)\/desk$/\1/"`
# setup the prompt.  Don't use the default because that will mess with the title of the window
export PS1="\[\e]0;"$DESK_NAME" \w\a\e[32m\u@\h \e[33m\w\e[0m\]\n$ "

Load .bashrc Settings

After updates are made to the .bashrc file, you can load/activate the updates by running the following command:

source .bashrc

NOTE: An alternate method to loading the new settings is to log out and log back in, but that is less interesting (and slower) than using the source command.

Useful Linux Commands

Linux Command Description
dpkg -S /desk/<path>/<filename.ext> Indicates the package that a file (or folder) belongs to. Example:

$ dpkg -S /desk/include/apex.h
deos653p1-runtime: /desk/include/apex.h

dpm <path>/<libname.so> Display the CRC/Integrity key of a library. Examples:

# Integrity key from desk lib
$ dpm /desk/arm/appbin/dbg/libvfile.so
Length Integrity Key(CRC) Filename
37369 0xabd18fc8 /desk/arm/appbin/dbg/libvfile.so


# Integrity key from local (instrumented) version lib
$ dpm ../output/arm-deos/instrumented/libdeos653p1.so

dos2unix <filename.ext> Convert a DOS-based line-ending file (e.g. CRLF) to unix line-ending format (e.g. LF)
find /desk -iname '<keyword>*' Search the /desk folders (and subfolders) for a filename containing the specified "keyword". Example:
find /desk -iname 'traceaid*'
grep -r <keyword> <path> Basic search within the path (and subfolders) for a file containing the specified "keyword"
grep -rnl -e <keyword> /desk Search the /desk folder (and subfolders) for a file containing the specified "keyword".
NOTE: you can specify multiple keywords by repeating -e <keyword> arguments
pwd Display the current directory path (Print Working Directory)
wc <filename.ext> Display the line numbers, words, and byte count